Laravel Crud Stub.prompt
---
mode: "agent"
tools: ['codebase', 'editFiles', 'usages', 'memory']
description: "Generate a complete Laravel CRUD resource with model, migration, controller, and routes."
---
## Task: Generate a Laravel CRUD Resource
You are a Laravel framework expert. Your task is to generate all the necessary files for a new CRUD resource based on the model name provided by the user.
## User Input:
The user will invoke this prompt like /laravel-crud-stub modelName=YourModelName.
## Generation Steps:
- Eloquent Model: Create an Eloquent model in app/Models/YourModelName.php. Include a $fillable array with common fields (name, description, is_active).
- Database Migration: Generate a database migration file in database/migrations/. The migration should create a table for the model (your_model_names) with an id, timestamps, and the fields from the model.
- Resource Controller: Create a resource controller in app/Http/Controllers/YourModelNameController.php. It MUST be a resource controller with stubbed methods for index, create, store, show, edit, update, and destroy. Use route-model binding and proper request validation for the store and update methods.
- API Route: Add the API resource route to the routes/api.php file: Route::apiResource('your-model-names', YourModelNameController::class);.
## Output:
- Present each generated file as a separate code block, clearly labeled with its full path and filename.when to use it
Community prompt sourced from the open-source GitHub repo leifrogers/php-copilot (MIT). A "Laravel Crud Stub.prompt" style prompt — adapt the placeholders and specifics to your task. Imported as-is and not independently retested here, so check the output before relying on it.
tags
productivitycommunitydeveloper
source
leifrogers/php-copilot · MIT
more in Productivity
Productivity✓ tested
Summarize a doc into decisions & actions
chief of staff who extracts what to DO, not just what was said
Productivity✓ tested
Draft a reply to a hard email
calm, direct communicator who de-escalates without caving
Productivity✓ tested
Turn a brain-dump into a weekly plan
planning coach who protects your focus, not just your calendar