feat: add account unlock/lock notifications

This commit is contained in:
2022-03-07 19:43:14 +00:00
parent a4f41b8f8d
commit a265debe4c
4 changed files with 151 additions and 0 deletions

View File

@@ -4,6 +4,8 @@
namespace App\Services;
use App\Ban;
use App\Notifications\AccountLocked;
use App\Notifications\AccountUnlocked;
use App\User;
use Carbon\Carbon;
use Illuminate\Support\Facades\Auth;
@@ -81,6 +83,8 @@ class AccountSuspensionService
]);
$user->administratively_locked = 1;
$user->notify(new AccountLocked);
return $user->save();
}
@@ -98,6 +102,8 @@ class AccountSuspensionService
]);
$user->administratively_locked = 0;
$user->notify(new AccountUnlocked);
return $user->save();
}