2017-09-03 2 views

Antwort

0

Blick auf EntrustUserTrait Zeilen 69-80.

/** 
* Boot the user model 
* Attach event listener to remove the many-to-many records when trying to delete 
* Will NOT delete any records if the user model uses soft deletes. 
* 
* @return void|bool 
*/ 
public static function boot() 
{ 
    parent::boot(); 
    static::deleting(function($user) { 
     if (!method_exists(Config::get('auth.model'), 'bootSoftDeletes')) { 
      $user->roles()->sync([]); 
     } 
     return true; 
    }); 
} 

Ich glaube, Sie verwenden nicht Laravel eigenen SoftDeletes Eigenschaft, wenn Sie nicht bootSoftDeletes haben.

class User extends Authenticatable 
{ 
    use SoftDeletes; 
    use EntrustUserTrait; 
    ...