feat(权限): 安装和配置 Spatie Permission 包
- 安装 spatie/laravel-permission 包(v6.24.1) - 发布配置文件和迁移文件 - 运行迁移创建权限表 - 在 User 模型中添加 HasRoles trait - 添加 isSuperAdmin 和 isAdmin 辅助方法 - 创建 PermissionSeeder 定义 45 个权限 - 创建 3 个预设角色(super-admin、admin、user) - 为角色分配相应权限 - 为第一个用户分配超级管理员角色
This commit is contained in:
@@ -65,7 +65,7 @@ return [
|
||||
|
||||
'temporary_file_upload' => [
|
||||
'disk' => null, // Example: 'local', 's3' | Default: 'default'
|
||||
'rules' => null, // Example: ['file', 'mimes:png,jpg'] | Default: ['required', 'file', 'max:12288'] (12MB)
|
||||
'rules' => ['required', 'file', 'max:51200'], // 最大 50MB
|
||||
'directory' => null, // Example: 'tmp' | Default: 'livewire-tmp'
|
||||
'middleware' => null, // Example: 'throttle:5,1' | Default: 'throttle:60,1'
|
||||
'preview_mimes' => [ // Supported file types for temporary pre-signed file URLs...
|
||||
@@ -73,7 +73,7 @@ return [
|
||||
'mov', 'avi', 'wmv', 'mp3', 'm4a',
|
||||
'jpg', 'jpeg', 'mpga', 'webp', 'wma',
|
||||
],
|
||||
'max_upload_time' => 5, // Max duration (in minutes) before an upload is invalidated...
|
||||
'max_upload_time' => 10, // Max duration (in minutes) before an upload is invalidated...
|
||||
'cleanup' => true, // Should cleanup temporary uploads older than 24 hrs...
|
||||
],
|
||||
|
||||
|
||||
Reference in New Issue
Block a user