You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Having the ability to easily specify an entity type and a entity id is awesome!
Bouncer::allow($user)->to('edit', Post::class);
Bouncer::allow($user)->to('edit', $post);
The entity class name is saved as a string in the entity_type column. This is simple and straightforward but what do you thing about moving this column to its own table?
Pros:
Database normalization.
Easy to change the entity class name without touching the abilities table.
Cons:
Additional table relationship to manage.
The text was updated successfully, but these errors were encountered:
Looks like a Morph Map could fix this issue.
Some people had this issue too and they added to the laravel repo what seems to be an undocumented method to map a string to a class name. See laravel/framework#9839
Will give it a try later and update.
Having the ability to easily specify an entity type and a entity id is awesome!
The entity class name is saved as a string in the
entity_type
column. This is simple and straightforward but what do you thing about moving this column to its own table?Pros:
Cons:
The text was updated successfully, but these errors were encountered: