hessnatur/simple-rest-crud-bundle
A Symfony bundle that adds simple RESTful CRUD capabilities to your application, helping you scaffold create, read, update, and delete endpoints with minimal configuration. Lightweight and straightforward for basic resource management.
First, the honest framing: this is a Symfony 4 bundle, not a Laravel package. It wires together fos-rest-bundle, jms-serializer, and lexik-form-filter-bundle, none of which have Laravel equivalents that drop in. You cannot composer require this into a Laravel app and get anything useful — there is no service provider, no facade, no config publishing. Treat it as a reference implementation of CRUD plumbing, not a dependency.
If you are evaluating it in a Symfony context (or reading it as a pattern source):
Resources/config/.composer.json for the pinned constraints — Symfony 4.x, FOSRestBundle, JMS Serializer, LexikFormFilterBundle. These versions are effectively frozen; FOSRestBundle itself has been retired.If you are a Laravel developer looking for the equivalent: skip the package and build the four moving parts it represents — an abstract resource controller, FormRequest validation, a query-filter layer, and API Resources for output shaping. That's roughly 200 lines and you own it.
The bundle's value is the separation it enforces. Borrow these patterns regardless of framework:
1. Abstract controller + per-entity subclass. The base controller owns the verbs (index/show/store/update/destroy); the subclass declares the entity class, form type, filter type, and serialization groups. In Laravel this maps cleanly to a base ApiController with abstract model(), storeRequest(), updateRequest(), and resource() methods, plus Route::apiResource.
2. Form/filter objects as the single input boundary. The bundle leans on Symfony Forms for both writes (validation + hydration) and reads (Lexik filter forms applied to a Doctrine QueryBuilder). The Laravel analogue for writes is FormRequest; for reads, a dedicated FilterRequest that whitelists sortable/filterable fields and hands a scoped query to the controller. Never let raw query params reach the query builder.
3. Serialization groups over ad-hoc arrays. JMS groups (list, detail, write) let one entity render differently per endpoint. Laravel's JsonResource / ResourceCollection is the direct replacement — define toArray() per context rather than scattering ->only() calls.
4. Query building isolated in a service. Keep filtering, sorting, and pagination in a query service (or Eloquent scope) so the controller stays thin and the logic is unit-testable without HTTP.
5. Consistent envelope and error shape. The bundle inherits FOSRestBundle's exception/error handling. In Laravel, standardize on one response shape (data, meta, errors) via a response macro or base controller method — retrofitting consistency later is painful.
6. Integration tip: if you must interoperate with a Symfony service running this bundle, consume its HTTP API rather than its PHP classes. The contracts are the routes and JSON shapes, not the abstract classes.
--ignore-platform-reqs gymnastics that you will regret.config/bundles.php), and there is no config/packages/*.yaml to publish. You will hand-write FOSRest, JMS, and Lexik config, and the bundle's expected keys won't be obvious.allow_extra_fields or careless handleRequest can hydrate fields you didn't intend. In Laravel terms: your FormRequest::validated() output should be the only thing passed to create()/update().bin/console debug:router to confirm the abstract controller actually generated routes, debug:container for the service wiring, and the profiler's Doctrine panel to catch N+1s introduced by serializing relations.apiResource routes, FormRequests, query scopes, and JsonResources — you'll get a maintainable result in an afternoon with no EOL dependencies attached.How can I help you explore Laravel packages today?