mirror of
https://github.com/Bubka/2FAuth.git
synced 2025-08-09 13:55:01 +02:00
Control & Promote administrator status via a method rather than a prop
This commit is contained in:
@ -59,7 +59,7 @@ class UserController extends Controller
|
||||
|
||||
Log::info(sprintf('Deletion of user ID #%s requested', $user->id));
|
||||
|
||||
if ($user->is_admin && User::admins()->count() == 1) {
|
||||
if ($user->isAdministrator() && User::admins()->count() == 1) {
|
||||
return response()->json(['message' => __('errors.cannot_delete_the_only_admin')], 400);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user