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:
2025-11-29 11:08:17 +09:00
parent 6e7f8566ef
commit c11c05b3ea
15 changed files with 543 additions and 12 deletions

View File

@@ -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.
*