Recipe
Laravel controller scaffold
Generate a resource controller, model, migration, and API routes in one pass.
Quick start
meridian scaffold Post --resource --api --model --migrationWhat you get
app/Http/Controllers/PostController.php— index, store, show, update, destroyapp/Models/Post.php— Eloquent model with fillable guarddatabase/migrations/*_create_posts_table.php— timestamped migrationroutes/api.php— Route::apiResource entry appended
Flags
| Flag | Effect |
|---|---|
--resource | Full REST controller |
--api | Exclude create/edit views |
--model | Generate Eloquent model |
--migration | Create migration file |
Next steps
Run php artisan migrate then hit /api/posts. See all recipes for more patterns.