entrust
entrust copied to clipboard
Deleting a user with the SoftDelete trait in Laravel 5 will clear its roles
If you delete a user with the SoftDeletes trait in Laravel 5 while using Entrust, it will clear the roles of the user. It's not meant to, but EntrustUserTrait is not updated for Laravel 5s trait naming conventions.
Line 38-40 in EntrustUserTrait.php you can find this:
if (!method_exists(Config::get('auth.model'), 'bootSoftDeletingTrait')) {
$user->roles()->sync([]);
}
In Laravel 5 the bootSoftDeletingTrait method was renamed to bootSoftDeletes.
Can we please get a fix for this? :)
I'm gonna take a look at this
Any solutions yet? I am also facing the same issue.
It is pretty easy to resolve..
Currently i had to make a dirty hack within my model by creating a bootSoftDeletingTrait
method. Until the solution is merged.
Entrust doesn't have softdeletes. SoftDeletes implementation is totally different than what is described in the documentation.
Hi there,
Any solution. I face the same issue here.
Thanks!
Any solutions yet? I am facing the same problem in laravel 5.3
Same problem on 5.4
Same problem on 5.4 as well
Same problem on 5.5 as well
Same problem on 5.6 as well