fix: role anggota tidak bisa dihapus via form edit user
This commit is contained in:
@@ -12,6 +12,11 @@ class UserObserver
|
||||
{
|
||||
public function updated(User $user): void
|
||||
{
|
||||
// Pastikan role anggota selalu ada
|
||||
if (! $user->hasRole('anggota')) {
|
||||
$user->assignRole('anggota');
|
||||
}
|
||||
|
||||
// Log perubahan status anggota
|
||||
if ($user->wasChanged('status')) {
|
||||
MemberStatusLog::create([
|
||||
|
||||
Reference in New Issue
Block a user