You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This might be not a bug, but a limitation and an expected behavior, but I didn't find it mentioned in docs.
namespace App\Observers;
use App\User;
class UserObserver
{
public function deleting(User $user)
{
$user->status |= User::STATUS_DELETED;
}
}
The model uses softDeletes, so it may look redundant while there's deleted_at property. However, I have a use case for this and I can imagine a case where I would want to change some other props on delete.
Should the UPDATE query (the one that sets deleted_at) after the event is fired include the status column? Would be nice. Note that I would not expect updating/updated event be invoked in this case.
Edit: Corrected method name in the code above from deleted to deleting.
The text was updated successfully, but these errors were encountered:
Unfortunately we don't support this version anymore. Please check out our support policy on which versions we are currently supporting. Can you please try to upgrade to the latest version and see if your problem persists? We'll help you out and re-open this issue if so.
Description:
This might be not a bug, but a limitation and an expected behavior, but I didn't find it mentioned in docs.
The model uses
softDeletes
, so it may look redundant while there'sdeleted_at
property. However, I have a use case for this and I can imagine a case where I would want to change some other props on delete.Should the UPDATE query (the one that sets
deleted_at
) after the event is fired include thestatus
column? Would be nice. Note that I would not expectupdating
/updated
event be invoked in this case.Edit: Corrected method name in the code above from
deleted
todeleting
.The text was updated successfully, but these errors were encountered: