netbrothers-gmbh/syncacc-bundle
Symfony bundle from netbrothers GmbH that integrates SyncAcc into your project, providing service and configuration wiring for account-synchronization workflows. Install with Composer and enable the bundle to add SyncAcc functionality to your Symfony app.
composer require <vendor>/<package> and publish the package assets: php artisan vendor:publish --tag=acl-config and --tag=acl-migrations (run php artisan migrate afterwards).config/acl.php (model/entity bindings, table names, cache settings) and the role/permission entities under src/Models (or src/Entities if the package uses Doctrine). The AclRole class is where the v3.0.1 change lands.AclRoleContract, AclPermissionContract, and the user-trait/has-roles interface.$role = AclRole::create(['id' => 'admin', 'name' => 'Administrator']); // note: explicit id required since v3.0.1
$permission = AclPermission::create(['id' => 'posts.edit', 'name' => 'Edit posts']);
$role->permissions()->attach($permission->id);
$user->assignRole('admin');
Gate::allows('posts.edit'); // or $user->can('posts.edit')
php artisan tinker and verify $user->hasRole('admin') and $user->can('posts.edit') before wiring middleware or Blade directives.AclRole entity no longer carries #[ORM\GeneratedValue], so role IDs are application-assigned. Treat the role ID as a stable slug (admin, editor, billing-manager) rather than an auto-increment integer, and use it everywhere: seeders, assignRole(), config-driven default roles, and tests.RolePermissionSeeder that upserts roles and permissions by ID, so re-running is idempotent and never depends on database-generated IDs:foreach (config('acl.roles') as $id => $definition) {
$role = AclRole::updateOrCreate(['id' => $id], ['name' => $definition['name']]);
$role->permissions()->sync($definition['permissions']);
}
AuthServiceProvider loop, then use standard $user->can() / @can in Blade and can: middleware on routes. This keeps the package out of your controllers.Cache::rememberForever('acl.map', ...)) and flush it on role/permission writes via model events or an observer.assertTrue($user->can('...')). Seed the role catalogue in setUp or via RefreshDatabase + seeder so tests never rely on generated IDs.AclRole id. Creating a role without an explicit id will now fail (NOT NULL / identifier required) instead of silently getting an auto-increment value. Audit every AclRole::create([...]), factory, and seeder call to supply an ID. If you were relying on $role->id being numeric, switch to string slugs.#[ORM\GeneratedValue] is a Doctrine ORM attribute. If your app is Eloquent-based, the change is invisible to you but signals the entity layer is Doctrine-first — check which mapper/entity manager the package expects before overriding models.updateOrCreate over create in seeders to avoid duplicate-key exceptions on redeploy.create() for the same role ID throws instead of creating a new row. Use upserts, or guard with firstOrCreate.acl.models.role points at your class (not the vendor default) if you extended AclRole; a stale binding is the most common cause of "role not found" after an upgrade.can() returns false unexpectedly, dump the resolved permission map (app(AclManager::class)->getPermissions($user)) before suspecting the gate — missing pivot rows after a manual-ID migration are the usual culprit.How can I help you explore Laravel packages today?