Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Crod Laravel Package

milwad/laravel-crod

Laravel CRUD generator that scaffolds controllers, models, migrations, routes, and views from a single Artisan command. Quickly build working resource management with customizable stubs and field definitions.

View on GitHub
Deep Wiki
Context7

Getting Started

Install the package with Composer (it only needs to exist at generation time, so a --dev install is usually fine unless your deploy pipeline runs generators):

composer require milwad/laravel-crod --dev

Laravel's package discovery registers the service provider automatically. Publish the config so you can see the knobs before your first run (tag name varies by version — check php artisan vendor:publish output if the tag below misses):

php artisan vendor:publish --tag="laravel-crod-config"

Then inspect the actual surface area of your installed version rather than trusting a README:

php artisan make:crud --help

The first real use case is scaffolding a single boring resource end-to-end — e.g. a Product with name, price, stock. Run the generator against a clean git working tree so every generated file shows up as an untracked diff, then read all of them in this order:

  1. database/migrations/*_create_products_table.php — check column types/nullability.
  2. app/Models/Product.php — check $fillable and casts.
  3. app/Http/Requests/* — this is where the real work starts.
  4. app/Http/Controllers/ProductController.php — the resource methods.
  5. routes/web.php — confirm exactly what got appended.
  6. resources/views/products/* — index/create/edit/show blades.

If anything is off, git checkout . and rm -rf the untracked files; the loop from "generate" to "clean tree" should take seconds.

Implementation Patterns

Treat the field string as the schema source of truth. The value of this package is that one declaration drives the migration, model casts, validation rules, and form inputs simultaneously. Decide your column list before you run anything; generating twice with a different field list is how you end up with a migration that half-matches the model.

Scaffold-then-edit, not scaffold-then-regenerate. This is a one-shot code generator, not a runtime framework. Once you have edited the controller, the generator no longer owns those files. Commit the generated output as your own code and never re-run the command over it. Teams that treat make:crud as an idempotent build step get overwritten authorization logic and duplicated routes.

Attach to an existing model. For resources where the model already exists (legacy tables, models with custom relations), point the generator at it rather than letting it create a second one, then hand-merge the migration if needed.

Post-generation checklist — do these every time, they are never generated for you:

  • Policies/gates and $this->authorize() calls in the controller.
  • authorize() returning true in the form requests, or a real ability check.
  • Rule::unique('products','name')->ignore($product) on the update request (generated unique rules usually don't know about the ignore).
  • ->constrained() on foreign key columns; the generator can't infer your relations.
  • Pagination + search on index(), and eager loading (with()) for any relation rendered in the blade.
  • $fillable as an explicit allow-list (see gotchas).

Integration with starter kits. The generated blades are standalone. If you're on Breeze/Jetstream/Filament, delete the generator's layout stub and swap @extends/<x-app-layout> to your existing shell — that's a five-minute sed across the four view files and saves you maintaining two layouts.

API variant. For JSON endpoints, generate normally, delete resources/views/* and the create/edit methods, then convert the remaining methods to JsonResource responses. The requests are the genuinely useful artifact here; the controller is a starting skeleton.

Route grouping. Generated routes land at the top level of routes/web.php. Immediately move them behind your admin prefix and middleware group (Route::middleware(['auth','can:admin'])->prefix('admin')->group(...)) rather than editing the generated block in place.

Gotchas and Tips

Re-runs duplicate routes and can clobber files. The most common failure mode is running the command a second time to "fix" a field and finding two identical Route::resource lines, a second migration, and a controller with your authorization code gone. Always git status after generating; if the package prompts to overwrite, say no unless you have nothing to lose.

Type-to-validation mapping is generic and shallow. string becomes required|string|max:255, integer becomes required|integer. There is no inference for email, url, enum, exists, unique, confirmed, or in:. Every generated request needs a five-minute pass. Budget for it — it is not optional polish.

$fillable may be empty or $guarded = []. If the model ships with $guarded = [], you have a mass-assignment hole the moment someone adds a is_admin column. Convert to an explicit $fillable array every time.

Naming conventions are inferred, so mismatches silently break things. Singular model / plural snake_case table / kebab-case route parameter. A model named Category produces categories fine, but BlogPost vs an existing blog_posts table with a custom $table is where it goes sideways — verify the migration's table name matches the model.

Publish and customize the config before onboarding the team. Set your default view stack (blade/tailwind/bootstrap), default namespace, and paths once and commit config/laravel-crod.php. Otherwise every developer generates subtly different output and your diffs become noise.

Read the stubs. If a generated file looks wrong, the answer is in vendor/milwad/laravel-crod/src/Stubs (or stubs/). That directory tells you far more than the README about what the package will and won't do — and if stubs are publishable in your version, that's your real extension point for enforcing house style (repository pattern, DTOs, base controller, custom form components).

Pin the version. ~128 stars and zero dependents means limited real-world edge-case coverage: expect rough handling of UUID/ULID primary keys, polymorphic relations, soft deletes, multi-tenancy, and non-standard primary key names. composer require milwad/laravel-crod:^x.y with an explicit constraint, and audit generated output rather than assuming it's idiomatic for your Laravel version.

Debugging failed generation: run with -v, check storage/logs/laravel.log, and confirm the target paths exist and are writable. Most failures are a namespace/path mismatch in config or a model name that doesn't resolve.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
3mdikram/worldmoneywords
snowsoft/config
itmosoft/laravel-subscriptions
larva/laravel-ai-qwen
diephp/sequences
users-au/socialite-provider
twidpay/twid-logger
mrnewport/laravel-plaid
mrnewport/laravel-repo
mrnewport/laravel-docsign
mrnewport/laravel-stow
mrnewport/laravel-flow
mrnewport/laravel-priceable
mrnewport/laravel-nestedterms
fredmeng/laravel-apidoc-generator
itstructure/laravel-multilingual-tools
pdustdar/elasticsearch
markupai/php-sdk
rlacerda83/lumem-microservice-shipment
uni-method/symfony-lib