27 lines
727 B
PHP
27 lines
727 B
PHP
<?php
|
|
|
|
namespace App\Http\Requests\Admin\System\Setting;
|
|
|
|
use App\Enums\Permission;
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
class SystemRequest extends FormRequest
|
|
{
|
|
public function authorize(): bool
|
|
{
|
|
return $this->user()?->can(Permission::SETTINGS_UPDATE->value) ?? false;
|
|
}
|
|
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'app_name' => ['required', 'string', 'max:100'],
|
|
'about_app' => ['nullable', 'string'],
|
|
'email' => ['nullable', 'email', 'max:100'],
|
|
'phone' => ['nullable', 'string', 'max:20'],
|
|
'logo' => ['nullable', 'image', 'max:2048'],
|
|
'login_cover' => ['nullable', 'image', 'max:5120'],
|
|
];
|
|
}
|
|
}
|