Maybe if you do this
public function delete() {
parent::delete();
// ...
}
You need to use late static binding.
public static function boot()
{
parent::boot();
Status::deleting(function($model)
{
$model->deleted_by = Auth::user()->id;
});
}
You may also want to verify that someone is actually logged in, for cases like cron jobs, commands etc.
I figured it out, it seems that you can't append a value to the model when you are soft deleting it. Adding the ->save option did make it work.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community