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

Api Crudify Laravel Package

mehedi8gb/api-crudify

Laravel package that generates standardized API CRUD (controller/service/repository/resources/requests/tests) and a query-driven pipeline for relations, filters, sorting, soft deletes, and pagination via URL params. Supports DDD namespaces and auto route/setup.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture Fit

  • Pros:

    • Service-Repository Pattern: Aligns with Laravel best practices, enforcing separation of concerns (HTTP layer, business logic, data access).
    • Chain of Responsibility Pipeline: Modular query handling (filtering, sorting, pagination) reduces boilerplate and improves maintainability.
    • Domain-Driven Design (DDD) Support: Nested namespaces (V1/Inventory/Product) enable scalable, modular API design.
    • Standardized Output: Generates controllers, services, repositories, tests, and migrations in one command, reducing manual setup.
    • Soft Delete & Relation Awareness: Built-in support for Eloquent soft deletes and eager loading reduces edge-case bugs.
    • Query Parameter Flexibility: Frontend-friendly ?q= shorthand and low-level ?where=/?orWhere= provide granular control.
  • Cons:

    • Monolithic Generation: Generates all CRUD components at once, which may be overkill for simple APIs or microservices where granularity is preferred.
    • Opinionated Structure: Enforces a strict 3-layer architecture, which may conflict with existing Laravel projects using alternative patterns (e.g., Facade-based services).
    • Limited Customization: Query pipeline handlers are pre-defined; extending or replacing them requires deep package knowledge.
    • No GraphQL Support: Focuses solely on RESTful APIs, which may limit adoption in projects using GraphQL or hybrid architectures.
    • Dependency on Eloquent: Tight coupling to Eloquent’s query builder may complicate projects using alternative ORMs (e.g., Doctrine).

Integration Feasibility

  • Laravel Compatibility: Designed for Laravel 10+ (based on last release date: 2026-05-09), with no major breaking changes expected for recent versions.
  • Dev Dependency: Installed via --dev, suggesting it’s intended for development environments only (e.g., scaffolding, not production).
  • Autoloading: Requires manual composer dump-autoload after installation, which could be automated in a custom script.
  • Route Registration: Automatically registers API routes, but may conflict with existing route definitions (e.g., API versioning, custom middleware).
  • Testing: Generates feature tests, but integration with existing test suites (e.g., Pest, PHPUnit) requires manual configuration.

Technical Risk

  • Low Risk:
    • MIT License: Permissive, no legal concerns.
    • Minimal Dependencies: Only requires Laravel core, reducing compatibility issues.
    • Well-Structured Codebase: Clear separation of concerns and documented architecture.
  • Medium Risk:
    • Package Maturity: Low GitHub stars (1) and dependents (0) suggest limited real-world adoption. Lack of community support could lead to unresolved issues.
    • Breaking Changes: Last major release (v4.2.0) introduced architectural refinements, which may not be backward-compatible with earlier versions.
    • Customization Overhead: Extending or modifying the query pipeline requires understanding the package’s internals (e.g., HandleApiQueryRequest, IQueryHandler).
  • High Risk:
    • No Official Documentation: README is comprehensive but lacks tutorials, migration guides, or troubleshooting sections.
    • Undocumented Edge Cases: Complex query parameters (e.g., nested relation filtering) may behave unexpectedly without thorough testing.
    • Performance Impact: Chain of Responsibility pipeline adds overhead to every API request. Caching (CacheHandler) is optional and not enabled by default.

Key Questions

  1. Alignment with Existing Architecture:
    • Does the project already use the Service-Repository pattern? If not, what are the risks of introducing it?
    • Are there existing query pipelines (e.g., custom middleware, Facades) that could conflict with api-crudify?
  2. Customization Needs:
    • Will the team need to extend or replace query handlers (e.g., adding authentication checks, custom validation)?
    • Are there specific API endpoints that shouldn’t follow the CRUD pattern (e.g., complex workflows, non-resource routes)?
  3. Testing Strategy:
    • How will generated tests integrate with the existing test suite? Are there gaps in test coverage (e.g., edge cases, error handling)?
  4. Performance:
    • What is the expected API request volume? Could the Chain of Responsibility pipeline introduce latency?
    • Are there plans to enable caching (CacheHandler) for high-traffic endpoints?
  5. Maintenance:
    • Who will own long-term maintenance of the package (e.g., updates, bug fixes)?
    • Is there a fallback plan if the package becomes unsupported or abandoned?
  6. Deployment:
    • How will generated code (e.g., migrations, factories) be version-controlled? Will they be committed to the repo or excluded?
    • Are there CI/CD pipelines to validate generated code before deployment?

Integration Approach

Stack Fit

  • Laravel Projects: Ideal for Laravel-based RESTful APIs, especially those requiring rapid CRUD scaffolding.
  • Monolithic Applications: Best suited for projects where all API logic resides within a single Laravel instance (not microservices).
  • Team Skillset: Requires familiarity with Laravel’s Eloquent, Service Container, and API development. Teams using alternative patterns (e.g., Facades, DTOs) may face a learning curve.
  • Frontend Integration: Frontend-friendly query parameters (?q=, ?trashed=with) simplify client-side filtering and sorting.

Migration Path

  1. Assessment Phase:
    • Audit existing API endpoints to identify candidates for CRUD automation (e.g., simple resource endpoints).
    • Document endpoints that require custom logic (e.g., multi-step workflows, non-CRUD operations).
  2. Pilot Phase:
    • Install the package in a development environment (composer require mehedi8gb/api-crudify --dev).
    • Run php artisan crudify:install and test the generated base classes.
    • Generate a single CRUD component (e.g., php artisan crudify:make Product) and evaluate:
      • Code quality and adherence to project standards.
      • Performance impact (e.g., request latency, memory usage).
      • Integration with existing middleware, authentication, and validation.
  3. Incremental Adoption:
    • Gradually migrate existing CRUD endpoints to the new pattern, starting with low-risk resources.
    • Use feature flags or route aliases to coexist with legacy endpoints during transition.
    • Refactor custom query logic into the Chain of Responsibility pipeline (e.g., add a CustomValidationHandler).
  4. Full Adoption:
    • Replace all manual CRUD endpoints with api-crudify-generated components.
    • Update documentation, API specs (e.g., OpenAPI/Swagger), and frontend clients to reflect new query parameters.
    • Remove or archive legacy CRUD code.

Compatibility

  • Laravel Versions: Tested with Laravel 10+ (as of 2026). Verify compatibility with the project’s Laravel version.
  • PHP Version: Requires PHP 8.1+ (based on Laravel 10+ support).
  • Existing Code:
    • Controllers: Generated controllers extend Laravel’s Controller class. Custom middleware or traits may need adjustment.
    • Models: Generated models extend app/Models/Model.php. Existing models may need to inherit from this base class or merge logic.
    • Routes: Automatically registers API routes in routes/api.php. Conflict resolution may be needed for existing routes.
    • Validation: Uses Laravel’s Form Requests. Custom validation rules must be added to the generated StoreRequest/UpdateRequest classes.
  • Third-Party Packages:
    • API Documentation: Tools like Swagger/OpenAPI may need updates to reflect new query parameters.
    • Testing Tools: Feature tests are generated but may require integration with existing test runners (e.g., Pest, PHPUnit).

Sequencing

  1. Pre-Integration:
    • Backup existing API code and database migrations.
    • Set up a staging environment to test the package.
  2. Installation:
    • Run composer require mehedi8gb/api-crudify --dev.
    • Execute php artisan crudify:install and verify base classes are generated.
  3. Configuration:
    • Update composer.json to include app/Helpers/Helpers.php in autoload.
    • Configure route middleware (e.g., api, auth:sanctum) in app/Http/Kernel.php.
  4. Pilot Implementation:
    • Generate a non-critical CRUD component (e.g., TestResource).
    • Test all query parameters (?q=, ?trashed=, ?sortBy=) and edge cases.
  5. Iterative Rollout:
    • Prioritize endpoints with the highest maintenance burden for migration.
    • Gradually replace manual CRUD logic with generated components.
  6. Post-Integration:
    • Update API documentation and client SDKs.
    • Monitor performance and error rates in production.
    • Train the team on customizing the package (e.g., adding query handlers).

Operational Impact

Maintenance

  • Pros:
    • Reduced Boilerplate: Automates generation of controllers, services, repositories, and tests, saving development time.
    • Standardized Code: En
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.
milito/query-filter
apiboxsym/user-bundle
apiboxsym/health-check-bundle
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui
babelqueue/php-sdk
facebook/capi-param-builder-php
babelqueue/symfony
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours