Closed Sentences closed 6 years ago
But it should be, better, something like:
$model = config('forum.integration.user_model');
if(method_exists($model, 'withTrashed')) {
return $this->belongsTo($model)->withTrashed();
}
return $this->belongsTo($model);
Because if someone doesn't use the SoftDeletes
trait it will crash cause of Call to undefined method
.
Fixed in b46766e102537729424894a447c7d8f43f44316b.
Hey there. Im using Laravel 5.1.46 When i work with softdeleted users, i get an Exception
To solve this, i have updated the HasAuthor Trait from
return $this->belongsTo(config('forum.integration.user_model'));
to
return $this->belongsTo(config('forum.integration.user_model'))->withTrashed();
Please add this to the options.