xiaohongshu
xiaohongshu
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/".
Full skill instructions
Expert assistance for Laravel and Nova package development, forked package management, and package integration workflows.
# 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
1. pcrcard/nova-menus - Hierarchical menu management
packages/nova-menus/2. pcrcard/nova-medialibrary-bounding-box-field - Media + damage assessment
packages/nova-medialibrary-bounding-box-field/Medialibrary, BoundingBoxFieldpackages/
├── 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
{
"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"
}
}
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>
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 directoryvue({ version: 3 }) - Vue 3 for Nova 5.xuniqueName - Prevents webpack conflictsversion() - Cache busting with mix-manifest.jsonnamespace 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');
});
}
{
"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
}
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
# 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()
npm run prod for production buildscomposer installSymptom: 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
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
},
})
Symptom: Nova field shows blank or error in console
Solution:
$component property matches registration name// ✅ CORRECT: Registration matches field $component
Nova.booting((app) => {
app.component('index-my-field', IndexField) // matches $component = 'my-field'
})
Symptom: vendor/pcrcard/<package> missing or broken
Solution:
rm -rf vendor/pcrcard/<package>
composer install # Recreates symlinks
Symptom: npm run dev or npm run prod fails
Solution:
rm -rf node_modules/
rm package-lock.json
npm install
npm run dev
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
}
}
<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>
// 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)
import { DependentFormField, HandlesValidationErrors } from 'laravel-nova'
export default {
mixins: [DependentFormField, HandlesValidationErrors],
// ...
}
docs/development/PACKAGE-FORK-INTEGRATION-PLAN.mdpackages/nova-medialibrary-bounding-box-field/README.mdpackages/nova-menus/README.mdscripts/lib/packages.shdocs/development/NOVA-ADMIN-GUIDE.md.claude/skills/nova-resource/SKILL.mdpackages/ directorycomposer.json with pcrcard/* namespacesrc/Fields/resources/js/components/resources/js/field.jswebpack.mix.js with externalscomposer.jsonscripts/lib/packages.sh get_forked_packages()composer installnpm run prodnpm run devnpm run prodcomposer update pcrcard/<package>git remote add upstream <url>git fetch upstreamgit log upstream/mastergit merge upstream/masterLast Updated: October 2025 Package Count: 2 (nova-menus, nova-medialibrary-bounding-box-field) Nova Version: 5.x (Vue 3, Laravel Mix 6.x)
xiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
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...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
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...
Display project status, active tracks, and next actions
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.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience