bouncer
bouncer copied to clipboard
How to override "assigned_roles" model ?
Hi,
I'd like to override "assigned_roles" model to add Auditable trait (which add timestamps and ID of user responsible of action on the model) but I don't find any Model for tables others than Ability and Role.
How can I override other Bouncer Models ?
regards
And same question for "permissions" model ?
I don't think you can at the moment. Looking closer at the code those tables are hardcoded.
If you look at this file: src/Conductors/AssignsRoles.php
You'll see the following function at the end
protected function newPivotTableQuery()
{
return Models::query('assigned_roles');
}
The same goes with permissions sadly.
@JosephSilber : Any chance to have Models for those table soon ? Could be very useful to be able to override them to handle custom data like (sofdeletes, ...) on abilities assignment ....