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

Crudify Laravel Package

mr.incognito/crudify

Laravel CRUD generator for API or web apps. One Artisan command scaffolds models, migrations, controllers, form requests, API resources, routes, and optional Blade views. Supports validation rules, nullable fields, foreign keys/constraints, defaults, excludes, and delete:crud cleanup.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture Fit

  • Pros:

    • Laravel-native: Leverages Laravel’s core components (Eloquent, Migrations, Controllers, Form Requests, API Resources) without introducing external dependencies, ensuring tight integration with existing codebases.
    • Modularity: Generates isolated components (e.g., --exclude=model or --exclude=migration), allowing incremental adoption or customization of specific layers (e.g., keep migrations but override controllers).
    • Dual-mode support: API and web CRUD generation accommodates both headless APIs (for SPAs/mobile) and server-rendered admin panels, aligning with modern Laravel architectures.
    • Validation-first: Type-aware rules (e.g., string|max:255) enforce consistency with Laravel’s validation system, reducing runtime errors.
    • Database-agnostic: Works with any Laravel-supported database (MySQL, PostgreSQL, SQLite) via migrations, avoiding vendor lock-in.
    • Test-ready: Built-in Pest tests and Rector support ensure compatibility with Laravel’s testing and refactoring workflows.
  • Cons:

    • Monolithic generation: While modular, the package generates tightly coupled components (e.g., controller + resource + request). Customizing one often requires tweaking others, limiting granularity.
    • Blade dependency: Web CRUDs rely on Blade templates, which may not align with projects using Inertia.js, Livewire, or Vue/React frontends. API-only mode mitigates this but isn’t always sufficient.
    • Limited extensibility hooks: No built-in events or middleware injection points for pre/post-CRUD logic (e.g., logging, auditing). Extensions require manual overrides.
    • Opinionated structure: Assumes standard Laravel directory layouts (e.g., app/Http/Controllers/Api/). Projects with custom structures (e.g., feature-based controllers) may need post-generation adjustments.

Integration Feasibility

  • High for greenfield projects: Ideal for new Laravel applications where conventions can be adopted upfront. Minimal setup required beyond composer require.
  • Moderate for existing codebases:
    • API-first: Low risk if used for new endpoints or internal tools. Existing routes/controllers can coexist if namespaced (e.g., Api\Generated\ vs. Api\Custom\).
    • Web CRUD: Higher risk if the project uses non-Blade templates (e.g., Livewire components). Requires either:
      • Disabling view generation (--exclude=views) and manually linking to custom templates.
      • Overriding the resources/views/ structure post-generation.
    • Database migrations: Safe for new tables but risky for existing schemas. The package does not handle:
      • Schema changes (e.g., adding columns to existing tables).
      • Complex relationships (e.g., many-to-many with pivot tables).
      • Custom migration logic (e.g., timestamps vs. nullableTimestamps).
  • Tooling compatibility:
    • Works with Laravel Forge/Vapor, Homestead, and Docker (no server-specific dependencies).
    • CI/CD friendly: Artisan commands can be scripted in deployment pipelines (e.g., generate CRUDs during migrate phase).
    • IDE support: Generates standard Laravel files, so autocompletion and refactoring tools (PHPStorm, VSCode) work out-of-the-box.

Technical Risk

Risk Area Severity Mitigation Strategy
Generated code quality Medium Review generated files for edge cases (e.g., validation rules, foreign key syntax). Use --exclude to opt out of problematic components.
Blade template rigidity High For web CRUDs, disable view generation (--exclude=views) and build custom templates. Pair with Inertia.js or Livewire for dynamic UIs.
Migration conflicts High Avoid generating migrations for existing tables. Use --exclude=migration and write custom migrations.
Validation oversights Medium Extend generated FormRequest classes for custom rules (e.g., unique:except,$id).
Testing gaps Medium Supplement built-in Pest tests with feature tests for critical CRUDs. Use delete:crud to clean up test artifacts.
Performance Low Generated controllers/resources follow Laravel best practices. Monitor API routes for bloat (e.g., unused fields in resources).
Long-term maintenance Medium Document customizations (e.g., "This CRUD uses a custom validator in App\Rules\"). Use composer update cautiously—test generated code after Laravel upgrades.

Key Questions for Stakeholders

  1. Architecture:

    • Are we using Blade for admin panels, or will we rely on Inertia.js/Livewire? (Affects web CRUD feasibility.)
    • Do we have custom controller/middleware patterns (e.g., feature-based namespaces) that conflict with generated code?
  2. Database:

    • Should we avoid auto-generating migrations for existing tables? (Risk of schema conflicts.)
    • Are there complex relationships (e.g., polymorphic, many-to-many) that this package doesn’t support?
  3. Validation:

    • Do we need custom validation logic beyond basic rules (e.g., business rules, API-specific checks)?
    • Should we extend generated FormRequest classes or override them entirely?
  4. API Design:

    • Will generated API resources include all fields (potential over-fetching) or need customization?
    • Do we require versioned APIs or GraphQL (this package is REST-only)?
  5. Maintenance:

    • How will we handle Laravel upgrades? (Test generated code after composer update.)
    • Should we customize templates (e.g., add branding, default layouts) or use the package’s defaults?
  6. Team Adoption:

    • Will developers trust auto-generated code for production, or is this limited to prototypes/internal tools?
    • Do we need training on the package’s syntax (e.g., field definitions, --exclude flags)?

Integration Approach

Stack Fit

  • Best for:
    • Laravel 10+ applications with standard conventions (Eloquent, API Resources, Blade).
    • Internal tools, admin panels, or setup wizards where CRUD is repetitive but low-risk.
    • API-first projects where REST endpoints are needed quickly (e.g., for mobile apps or SPAs).
    • Teams using Artisan for scaffolding (e.g., make:model, make:controller) and want to reduce boilerplate.
  • Poor fit:
    • Projects using non-standard Laravel setups (e.g., custom ORMs, monolithic apps with embedded CRUD).
    • Public-facing products with unique UX requirements (e.g., e-commerce, social features).
    • Teams relying on GraphQL or gRPC instead of REST.
    • Applications with heavy middleware or event-driven workflows (e.g., queues, observers).

Migration Path

  1. Pilot Phase (Low Risk):

    • Generate non-critical CRUDs (e.g., TestModel) to validate output quality.
    • Test API mode first (lower risk than Blade templates).
    • Example:
      php artisan make:crud Settings --fields="key:string|unique,value:text" --type=api
      
    • Verify:
      • Routes are added to routes/api.php.
      • Validation works as expected.
      • API responses match requirements (e.g., no sensitive fields exposed).
  2. Incremental Adoption:

    • New features: Use the package for all new CRUDs (e.g., php artisan make:crud UserProfile).
    • Internal tools: Replace hand-written admin panels with generated web CRUDs (if Blade is acceptable).
    • Legacy systems: Avoid generating migrations for existing tables. Use --exclude=migration and write custom migrations.
  3. Customization:

    • Override templates: Copy generated files to a custom location (e.g., app/CustomCruds/) and modify as needed.
    • Extend validation: Add custom rules to generated FormRequest classes.
    • Modify views: For web CRUDs, replace Blade templates with custom ones (disable generation with --exclude=views).
  4. Full Integration:

    • Document the workflow (e.g., "Use make:crud for new models, then extend controllers for custom logic").
    • Train the team on:
      • Field syntax (e.g., foreign~|constrained:users).
      • Exclusion flags (e.g., --exclude=model).
      • Cleanup with delete:crud.

Compatibility

Component Compatibility Notes
Laravel Tested on Laravel 10–13. May require adjustments for older versions.
PHP Requires PHP
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.
terminal42/code-quality-tools
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky