Weave Code
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 Schema Rules Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Accelerated Development Velocity: Reduces manual validation rule creation by auto-generating schema-based rules, cutting development time for CRUD operations by 30-50% for new tables.
  • Consistency & Maintainability: Ensures validation rules align with the database schema, reducing discrepancies between frontend/backend contracts and eliminating "works in dev but not prod" bugs.
  • Developer Experience (DX) Improvements: Enables rapid prototyping by scaffolding Form Request classes (--create-request), reducing boilerplate code and onboarding time for new team members.
  • Build vs. Buy Decision: Avoids reinventing validation logic (e.g., custom scripts or manual rule definitions) while maintaining flexibility to override auto-generated rules for edge cases.
  • Use Cases:
    • CRUD-Heavy Applications: Ideal for admin panels, CMS backends, or SaaS platforms with frequent schema changes.
    • Legacy System Modernization: Quickly add validation to existing tables without rewriting rules from scratch.
    • API-Driven Projects: Generate consistent validation for both web and API routes (e.g., StorePersonRequest for REST endpoints).
    • Team Scaling: Reduces cognitive load for junior developers by providing a standardized starting point.

When to Consider This Package

  • Adopt When:

    • Your Laravel app relies heavily on database-driven validation (e.g., >50% of forms/tables).
    • You frequently update schemas and need to propagate changes to validation rules quickly.
    • Your team prioritizes speed over customization for baseline validation (e.g., MVPs, prototypes).
    • You use MySQL, PostgreSQL, or SQLite (no support for SQL Server/Oracle).
    • You’re already using Laravel’s Form Requests or controller validation.
  • Look Elsewhere If:

    • You need highly customized validation (e.g., complex regex, conditional rules) that can’t be expressed via schema alone.
    • Your app uses non-supported databases (e.g., SQL Server, MongoDB).
    • You require real-time validation (e.g., dynamic rules based on runtime logic).
    • Your team prefers explicit over implicit rules (e.g., for auditability or strict control).
    • You’re using Laravel 10 or below (though v1.3.6+ adds partial support; check compatibility).

How to Pitch It (Stakeholders)

For Executives:

"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."

For Engineers:

*"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:

  • Data types (strings, dates, enums, etc.) → Correct Laravel validators.
  • Constraints (max length, nullable fields, foreign keys) → Auto-generated rules.
  • Boilerplate → No more copying/pasting from Laravel’s docs.

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."*

For QA/DevOps:

*"This reduces validation-related bugs by ensuring rules match the schema. For example:

  • A string('email') column auto-generates ['required', 'string', 'email'] (if the name suggests it’s an email).
  • Foreign keys become ['required', 'exists:table,id'].
  • Nullable fields get ['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."*

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.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport