Answer the question
In order to leave comments, you need to log in
Why does withTrashed not exist?
My code
public function restore($params)
{
return User::withTrashed()->find(6)->restore();
}
class User extends Model
{
use SnakeCaseToCamelCaseTrait, SoftDeletes;
protected $table = 'users';
protected $guarded = ['id'];
protected $dates = ['created_at', 'updated_at', 'deleted_at'];
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question