laracraft-tech/laravel-schema-rules
Generate starter Laravel validation rules from your database schema. Create rules for entire tables or selected columns, optionally generate Form Request classes, and configure columns to always skip. Great for fast scaffolding before manual refinement.
--create-request), reducing boilerplate code and onboarding time for new team members.StorePersonRequest for REST endpoints).Adopt When:
Look Elsewhere If:
"This package cuts validation development time by automating 80% of rule generation from your database schema. For a team of 5 developers, that’s ~10 hours/week saved on CRUD features—freeing them to focus on high-impact work. It’s a no-code tool for developers, reducing busywork while maintaining consistency. The MIT license and active maintenance make it a low-risk, high-reward addition."
*"Laravel Schema Rules lets you generate schema-aware validation rules in seconds with a single Artisan command. Need rules for a new users table? Run php artisan schema:generate-rules users and paste the output into your Form Request. Want to scaffold a full request class? Add --create-request. It handles:
Pros: ✅ 3x faster than manual rule writing. ✅ Always in sync with your schema (no drift). ✅ Extensible—override auto-generated rules as needed. ✅ Works with Laravel 11–13 (and Form Requests).
Cons: ⚠️ Not a silver bullet for complex validation (e.g., cross-field logic). ⚠️ Limited to schema-based rules (e.g., no dynamic rules).
Try it: composer require laracraft-tech/laravel-schema-rules and run php artisan schema:generate-rules users --create-request to see the magic."*
*"This reduces validation-related bugs by ensuring rules match the schema. For example:
string('email') column auto-generates ['required', 'string', 'email'] (if the name suggests it’s an email).['required', 'exists:table,id'].['nullable'].Risk: False positives if the schema isn’t perfectly named (e.g., a user_id column might not auto-detect as a foreign key). Mitigation: Use --columns to specify fields or override rules post-generation."*
How can I help you explore Laravel packages today?