Open Maiti opened 8 years ago
I had the same problem. SoftDeletes restore method is conflicting with EntrustUserTrait restore method. Example solution:
use SoftDeletes, EntrustUserTrait {
SoftDeletes::restore insteadof EntrustUserTrait;
EntrustUserTrait::restore insteadof SoftDeletes;
}
Further info: http://stackoverflow.com/questions/25064470/collisions-with-other-trait-methods
This works better, but will need checking in case EntrustUserTrait restore method changes:
use SoftDeletes, EntrustUserTrait {
SoftDeletes::restore as sfRestore;
EntrustUserTrait::restore as euRestore;
}
public function restore() {
$this->sfRestore();
Cache::tags(Config::get('entrust.role_user_table'))->flush();
}
Related: https://github.com/Zizaco/entrust/issues/428
@ravloony Shouldn't the restore
method call both trait restore methods?
@sebastiaanluca no because both restore methods will call parent::restore()
how to fix FatalErrorException "Trait method restore has not been applied, because there are collisions with other trait methods on ..." in this code:
help me please
and need laravel 5.2 support)