mirror of
https://github.com/flarum/core.git
synced 2025-10-19 02:36:08 +02:00
@@ -115,13 +115,13 @@ class User extends AbstractModel
|
||||
parent::boot();
|
||||
|
||||
// Don't allow the root admin to be deleted.
|
||||
static::deleting(function (User $user) {
|
||||
static::deleting(function (self $user) {
|
||||
if ($user->id == 1) {
|
||||
throw new DomainException('Cannot delete the root admin');
|
||||
}
|
||||
});
|
||||
|
||||
static::deleted(function (User $user) {
|
||||
static::deleted(function (self $user) {
|
||||
$user->raise(new Deleted($user));
|
||||
|
||||
Notification::whereSubject($user)->delete();
|
||||
|
Reference in New Issue
Block a user