Laratrust\Traits\LaratrustGroupTrait::bootLaratrustGroupTrait PHP Метод

bootLaratrustGroupTrait() публичный статический Метод

Boot the permission model Attach event listener to remove the many-to-many records when trying to delete Will NOT delete any records if the group model uses soft deletes.
public static bootLaratrustGroupTrait ( ) : void | boolean
Результат void | boolean
    public static function bootLaratrustGroupTrait()
    {
        static::deleting(function ($group) {
            if (!method_exists(Config::get('laratrust.group'), 'bootSoftDeletes')) {
                $group->roles()->sync([]);
                $group->users()->sync([]);
            }
        });
    }