- How does api-crudify reduce boilerplate for Laravel API development?
- The package generates all CRUD components—controllers, services, repositories, API resources, requests, tests, and migrations—in a single command. It also auto-registers routes and handles query pipelines (filtering, sorting, relations) via URL params, eliminating repetitive manual setup.
- Does api-crudify support Laravel 11? The changelog is unclear.
- The package’s latest version (4.2.2) does not explicitly mention Laravel 11 support. Given no updates since 2023, test thoroughly in a staging environment before adopting it for Laravel 11 projects. Assume compatibility with Laravel 10.x only unless confirmed otherwise.
- Can I customize the query pipeline (e.g., add a caching handler)?
- The pipeline is modular, but the `CacheHandler` was removed in 4.2.2. You can extend existing handlers or create new ones by implementing the `QueryHandler` interface, but document all customizations—no active development means no community fixes if issues arise.
- Will this package work with my existing Laravel API that has custom business logic?
- For new APIs, it integrates seamlessly. For existing ones, manually merge generated files with your logic, but avoid relying on removed features like `CacheHandler`. Test edge cases (e.g., nested relations, complex filters) to ensure compatibility with your workflow.
- How does api-crudify handle soft deletes and pagination?
- Soft deletes are managed via query params like `?trashed=with` or `?trashed=only`. Pagination is auto-applied to responses, with configurable limits. Both features integrate into the Chain of Responsibility pipeline, ensuring consistency across all CRUD operations.
- Is there a performance impact from using api-crudify? Any benchmarks?
- The package avoids N+1 queries by intelligently loading relations (respecting `$with` or eager loads). However, no official benchmarks exist. Test with your dataset—dynamic filtering and sorting could impact performance if overused. Cache responses manually if needed.
- Can I use api-crudify for non-CRUD endpoints (e.g., analytics, reports)?
- No. This package is designed exclusively for CRUD APIs. For non-CRUD logic (e.g., reports), use Laravel’s built-in controllers or packages like Laravel Scout. The package’s pipeline and auto-generation won’t apply to custom endpoints.
- How do I handle edge cases like invalid filters or malformed requests?
- The package includes FormRequests for validation, which reject malformed inputs. Invalid filters (e.g., unsupported fields) are caught by the pipeline’s `FilterHandler` and return HTTP 422 errors. Test with extreme inputs to validate robustness.
- What’s the migration path if I decide to stop using api-crudify later?
- Generated files (controllers, services, etc.) are standalone PHP classes. Delete the package, then manually refactor or regenerate missing logic. Document dependencies early—no active development means no migration tools or support.
- Are there alternatives to api-cudify for Laravel CRUD automation?
- Yes. Consider `laravel-model-factory` (simpler), `spatie/laravel-query-builder` (flexible filtering), or `orchid/platform` (admin panels with CRUD). For DDD-focused projects, build custom repositories or use `laravel-ide-helper` for boilerplate reduction. Evaluate based on your need for auto-routes, pipelines, or testing.