sdsdev/rest-bundle-doctrine
Doctrine integration for the SDS REST Bundle. It bridges REST resources with Doctrine ORM entities, repositories, and queries, simplifying persistence and data access for Symfony APIs and reducing boilerplate when building Doctrine-backed REST endpoints. Configure entity mapping and repository-backe...
Install the package via Composer (consult the package README for the exact vendor/package name), then publish any configuration if required. Start by locating the entity base class or trait that provides many-to-many relationship handling—this is where 0.3.7’s fix lives.
First use case: define an entity with a many-to-many relation, then save related IDs as an array instead of loading models:
$entity->relatedEntities()->sync([1, 2, 3]);
// or, if the package exposes a custom save method:
$entity->saveManyToMany('relatedEntities', [1, 2, 3]);
Prior to 0.3.7, many-to-many saving on entities could fail or behave unpredictably. Upgrade to ^0.3.7 before relying on array-based saves.
'related_ids' => ['array'], 'related_ids.*' => ['integer', 'exists:related,id']), then pass the validated array straight to the entity save call.sync()/attach() still work; the 0.3.7 change mainly benefits the package’s custom entity save path.>=0.3.7.sync() deduplicates, but attach() may not. Prefer sync() when the array comes from user input.role, position, etc., use a keyed array ([1 => ['role' => 'admin']]) only if the package documents it; otherwise fall back to Eloquent’s syncWithPivotValues().saved, created) to hook post-sync logic.How can I help you explore Laravel packages today?