Skip to content
Laravel Package Specialist logo

Laravel Package Specialist

Laravel and Nova package development, forked package management, VCS path repositories, webpack configuration, and package integration workflows. Triggers include "package", "nova field", "nova tool", "webpack.mix.js", "pcrcard/nova-*", "packages/".

SKILL.md

Full skill instructions

Laravel Package Specialist

Expert assistance for Laravel and Nova package development, forked package management, and package integration workflows.

When to Use

  • Creating or modifying Laravel Nova fields
  • Developing Nova resources, tools, or lenses
  • Managing forked packages (pcrcard/​nova-*)
  • Building and deploying package assets
  • Configuring webpack for Nova packages
  • Package versioning and git workflows
  • Troubleshooting package integration issues
  • Syncing with upstream package forks

Quick Commands

# Package management
./​scripts/​dev.sh pkg:list                    # List all forked packages
./​scripts/​dev.sh pkg:status                  # Show package status
./​scripts/​dev.sh pkg:clone [package-name]    # Clone packages
./​scripts/​dev.sh pkg:update [package-name]   # Update from remote
./​scripts/​dev.sh pkg:build <package-name>    # Build and reinstall

# Package development workflow
cd packages/<package-name>/
npm install
npm run dev                   # Development build
npm run prod                  # Production build
git add .
git commit -m "feat: description"
git push origin master
composer update pcrcard/<package-name>  # Update main app

PCR Card Package Architecture

Forked Packages

1. pcrcard/​nova-menus - Hierarchical menu management

2. pcrcard/​nova-medialibrary-bounding-box-field - Media + damage assessment

Package Structure

packages/
├── nova-menus/
│   ├── src/                # PHP source (Fields, Tools, Resources)
│   ├── resources/          # Vue components, CSS
│   │   └── js/
│   ├── dist/               # Compiled assets (committed)
│   ├── composer.json       # Package metadata
│   ├── package.json        # npm dependencies
│   └── webpack.mix.js      # Laravel Mix configuration
└── nova-medialibrary-bounding-box-field/
    ├── src/
    │   └── Fields/         # Nova field classes
    ├── resources/
    │   └── js/​components/  # Vue 3 components
    ├── dist/               # Compiled assets
    ├── docs/               # Package documentation
    ├── composer.json
    ├── package.json
    └── webpack.mix.js

Composer Configuration

{
    "repositories": {
        "nova-menus": {
            "type": "path",
            "url": "packages/​nova-menus"
        },
        "nova-medialibrary-field": {
            "type": "path",
            "url": "packages/​nova-medialibrary-bounding-box-field"
        }
    },
    "require": {
        "pcrcard/​nova-menus": "@dev",
        "pcrcard/​nova-medialibrary-bounding-box-field": "@dev"
    }
}

Package Development Patterns

1. Creating New Nova Field

PHP Field Class (src/​Fields/​MyField.php):

namespace Vendor\Package\Fields;

use Laravel\Nova\Fields\Field;

class MyField extends Field
{
    public $component = 'my-field';

    public function __construct($name, $attribute = null, callable $resolveCallback = null)
    {
        parent::__construct($name, $attribute, $resolveCallback);
    }

    // Custom methods for field configuration
    public function withConfig(array $config): self
    {
        return $this->withMeta(['config' => $config]);
    }
}

Vue Component Registration (resources/​js/​field.js):

import IndexField from './​components/​IndexField'
import DetailField from './​components/​DetailField'
import FormField from './​components/​FormField'

Nova.booting((app, store) => {
  app.component('index-my-field', IndexField)
  app.component('detail-my-field', DetailField)
  app.component('form-my-field', FormField)
})

Component Template (resources/​js/​components/​FormField.vue):

<template>
  <DefaultField
    :field="field"
    :errors="errors"
    :show-help-text="showHelpText"
  >
    <template #field>
      <div class="my-field-wrapper">
        <!-- Your field UI -->
      </​div>
    </​template>
  </​DefaultField>
</​template>

<script>
import { DependentFormField, HandlesValidationErrors } from 'laravel-nova'

export default {
  mixins: [DependentFormField, HandlesValidationErrors],

  props: ['resourceName', 'resourceId', 'field'],

  methods: {
    fill(formData) {
      formData.append(this.field.attribute, this.value || '')
    }
  }
}
</​script>

2. Webpack Configuration (Nova 5.x)

Standard webpack.mix.js for Nova Packages:

let mix = require('laravel-mix')

mix
  .setPublicPath('dist')
  .js('resources/​js/​field.js', 'js')
  .vue({ version: 3 })
  .css('resources/​css/​field.css', 'css')
  .webpackConfig({
    externals: {
      vue: 'Vue',
      'laravel-nova': 'LaravelNova',
      'laravel-nova-ui': 'LaravelNovaUi',
    },
    output: {
      uniqueName: 'vendor/​package',
    },
  })
  .version()

Key Points:

  • setPublicPath('dist') - Output directory
  • vue({ version: 3 }) - Vue 3 for Nova 5.x
  • Externals - Don't bundle Vue/​Nova (provided by Nova)
  • uniqueName - Prevents webpack conflicts
  • version() - Cache busting with mix-manifest.json

3. Service Provider Registration

namespace Vendor\Package;

use Laravel\Nova\Nova;
use Laravel\Nova\Events\ServingNova;
use Illuminate\Support\ServiceProvider;

class FieldServiceProvider extends ServiceProvider
{
    public function boot()
    {
        Nova::serving(function (ServingNova $event) {
            Nova::script('my-field', __DIR__.'/​../​dist/​js/​field.js');
            Nova::style('my-field', __DIR__.'/​../​dist/​css/​field.css');
        });
    }

    public function register()
    {
        //
    }
}

Alternative (Laravel Mix manifest):

public function boot()
{
    Nova::serving(function (ServingNova $event) {
        Nova::mix('my-field', __DIR__.'/​../​dist/​mix-manifest.json');
    });
}

4. Package composer.json

{
    "name": "pcrcard/​my-nova-field",
    "description": "My Nova field description",
    "keywords": ["laravel", "nova", "field"],
    "license": "MIT",
    "require": {
        "php": "^8.2",
        "laravel/​nova": "^5.0"
    },
    "autoload": {
        "psr-4": {
            "Pcrcard\\MyNovaField\\": "src/"
        }
    },
    "extra": {
        "laravel": {
            "providers": [
                "Pcrcard\\MyNovaField\\FieldServiceProvider"
            ]
        }
    },
    "minimum-stability": "dev",
    "prefer-stable": true
}

Development Workflows

Package Development Workflow

Complete workflow for modifying a package:

# 1. Navigate to package directory
cd packages/​nova-medialibrary-bounding-box-field/

# 2. Make code changes
# Edit src/​Fields/​BoundingBoxField.php
# Edit resources/​js/​components/​FormField.vue

# 3. Build assets
npm run dev          # Development build (faster)
npm run prod         # Production build (minified)

# 4. Test in main app
cd ../​..
composer update pcrcard/​nova-medialibrary-bounding-box-field

# 5. Commit to package repo
cd packages/​nova-medialibrary-bounding-box-field/
git add .
git commit -m "feat: Add new feature to bounding box editor"
git push origin master

# 6. Update main app (optional)
cd ../​..
composer update pcrcard/​nova-medialibrary-bounding-box-field

Creating New Forked Package

# 1. Fork upstream package on GitHub
# 2. Clone into packages/ directory
cd packages/
git clone https://github.com/​hackur/​new-package.git

# 3. Update composer.json namespace
cd new-package/
# Edit composer.json: Change namespace to "pcrcard/​*"

# 4. Add to main app composer.json
cd ../​..
# Add repository and require to composer.json

# 5. Install package
composer install

# 6. Update package management script
# Edit scripts/​lib/​packages.sh - add to get_forked_packages()

Best Practices

Git Workflow

  • ✅ ALWAYS commit to package repo first, then main app
  • ✅ Use semantic versioning tags (v1.0.0, v2.0.0)
  • ✅ Keep package and app commits separate
  • ✅ Reference package commits in app commit messages
  • ✅ Push to fork remote (origin), not upstream

Asset Building

  • ✅ Build in package directory (not main app)
  • ✅ Use npm run prod for production builds
  • ✅ COMMIT dist/ files to package repo (required for Nova)
  • ❌ Never commit node_modules/
  • ✅ Test builds locally before committing

Dependencies

  • ✅ External packages in externals config (Vue, Nova, etc.)
  • ❌ Don't bundle Nova or Vue in package assets
  • ✅ Use @dev version constraint for local development
  • ✅ Lock upstream versions in package.json

Symlinks

  • ✅ Composer creates symlinks automatically
  • ✅ vendor/​pcrcard/​* → packages/​*
  • ❌ Don't modify symlinks manually
  • ✅ Rebuild symlinks: composer install

Troubleshooting

Package Changes Not Reflected

Symptom: Modified package code doesn't appear in Nova

Solution:

cd packages/<package>/
npm run dev                               # Rebuild assets
cd ../​..
composer update pcrcard/<package>         # Update main app
php artisan nova:publish                  # Republish Nova assets
php artisan cache:clear                   # Clear cache

Webpack Errors (Cannot Find Module)

Symptom: Module not found: Error: Can't resolve 'laravel-nova'

Solution: Check externals configuration

// webpack.mix.js
.webpackConfig({
    externals: {
        vue: 'Vue',                         // ✅ Must be externalized
        'laravel-nova': 'LaravelNova',     // ✅ Must be externalized
        'laravel-nova-ui': 'LaravelNovaUi', // ✅ Must be externalized
    },
})

Vue Component Not Rendering

Symptom: Nova field shows blank or error in console

Solution:

  1. Check component registration in field.js
  2. Verify $component property matches registration name
  3. Check browser console for errors
  4. Verify Vue 3 syntax (Composition API vs Options API)
// ✅ CORRECT: Registration matches field $component
Nova.booting((app) => {
  app.component('index-my-field', IndexField)  // matches $component = 'my-field'
})

Symlink Broken

Symptom: vendor/​pcrcard/<package> missing or broken

Solution:

rm -rf vendor/​pcrcard/<package>
composer install                  # Recreates symlinks

Asset Build Fails

Symptom: npm run dev or npm run prod fails

Solution:

rm -rf node_modules/
rm package-lock.json
npm install
npm run dev

Package Not Found After Installation

Symptom: Composer can't find package

Solution: Verify composer.json configuration

{
    "repositories": {
        "my-package": {
            "type": "path",
            "url": "packages/​my-package"  // ✅ Correct path
        }
    },
    "require": {
        "pcrcard/​my-package": "@dev"      // ✅ Correct constraint
    }
}

Nova 5.x Specific Patterns

Vue 3 Component Structure

<script setup>
import { ref, computed } from 'vue'

const props = defineProps({
  resourceName: String,
  resourceId: [String, Number],
  field: Object,
})

const value = ref(props.field.value || '')

const fill = (formData) => {
  formData.append(props.field.attribute, value.value)
}

defineExpose({ fill })
</​script>

Field Meta Data

// Pass data to Vue component
MyField::make('Name')
    ->withMeta([
        'config' => [
            'option1' => true,
            'option2' => 'value',
        ],
    ]);

Access in Vue:

// this.field.config (Options API)
// props.field.config (Composition API)

Nova Mixins (Options API)

import { DependentFormField, HandlesValidationErrors } from 'laravel-nova'

export default {
  mixins: [DependentFormField, HandlesValidationErrors],
  // ...
}

Documentation References

Package Documentation

  • Package fork integration: docs/​development/​PACKAGE-FORK-INTEGRATION-PLAN.md
  • BoundingBox field: packages/​nova-medialibrary-bounding-box-field/​README.md
  • Nova menus: packages/​nova-menus/​README.md
  • Package scripts: scripts/​lib/​packages.sh

Related Guides

  • Nova Admin Guide: docs/​development/​NOVA-ADMIN-GUIDE.md
  • Nova Resource Builder skill: .claude/​skills/​nova-resource/​SKILL.md

External Resources

Common Tasks Checklist

Creating New Nova Field Package

  • Fork upstream package (if applicable)
  • Clone into packages/ directory
  • Update composer.json with pcrcard/​* namespace
  • Create PHP field class in src/​Fields/
  • Create Vue components in resources/​js/​components/
  • Set up component registration in resources/​js/​field.js
  • Configure webpack.mix.js with externals
  • Create service provider with Nova::serving()
  • Add package to main composer.json
  • Add to scripts/​lib/​packages.sh get_forked_packages()
  • Run composer install
  • Build assets: npm run prod
  • Commit dist/ files
  • Test in Nova admin

Modifying Existing Package

  • Navigate to package directory
  • Create feature branch (optional)
  • Make code changes
  • Build assets: npm run dev
  • Test in main app
  • Build production assets: npm run prod
  • Commit changes (including dist/)
  • Push to remote fork
  • Update main app: composer update pcrcard/<package>

Syncing with Upstream

  • Add upstream remote: git remote add upstream <url>
  • Fetch upstream: git fetch upstream
  • Review changes: git log upstream/​master
  • Merge or rebase: git merge upstream/​master
  • Resolve conflicts
  • Rebuild assets
  • Test thoroughly
  • Commit and push

Last Updated: October 2025 Package Count: 2 (nova-menus, nova-medialibrary-bounding-box-field) Nova Version: 5.x (Vue 3, Laravel Mix 6.x)

More skills from majiayu000

xiaohongshu logo
majiayu000/claude-arsenal

xiaohongshu

xiaohongshu

286 148
View
agent-task-conductor logo
majiayu000/claude-skill-registry

agent-task-conductor

Conduct multi-agent task orchestration and workflow coordination.

663 1
View
conductor-setup logo
majiayu000/claude-skill-registry

conductor-setup

Initialize project with Conductor artifacts (product definition,

663 1
View
animation-designer logo
majiayu000/claude-skill-registry

animation-designer

Expert in web animations, transitions, and motion design using Framer Motion and CSS

663 1
View
diagramming logo
majiayu000/claude-skill-registry

diagramming

Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...

663 1
View
h3-pg logo
majiayu000/claude-skill-registry-data

h3-pg

PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.

23 1
View
conductor-development logo
majiayu000/claude-skill-registry

conductor-development

Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...

663 1
View
conductor-status logo
majiayu000/claude-skill-registry

conductor-status

Display project status, active tracks, and next actions

663 1
View
dockerization logo
majiayu000/claude-skill-registry

dockerization

Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.

663 1
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View