Add admin user management and improve UX
Features: - Add user management for admins (CRUD operations) - Add is_admin column to users table - Add AdminMiddleware for authorization - Add admin routes and views - Add artisan command: user:set-admin Improvements: - Fix Quick Switcher: add x-data for Alpine.js dispatch - Fix Quick Switcher: close on outside click - Redirect non-admin users to front page after login - Add Knowledge Base link in dashboard navigation - Change app logo from Laravel to book icon
This commit is contained in:
@@ -21,8 +21,19 @@ class User extends Authenticatable
|
||||
'name',
|
||||
'email',
|
||||
'password',
|
||||
'is_admin',
|
||||
];
|
||||
|
||||
/**
|
||||
* Check if user is an administrator.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isAdmin(): bool
|
||||
{
|
||||
return (bool) $this->is_admin;
|
||||
}
|
||||
|
||||
/**
|
||||
* The attributes that should be hidden for serialization.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user