store/app/Http/Requests/Admin/System/Setting/SystemRequest.php
Yoga Pangestu d02af40836
Some checks failed
linter / quality (push) Waiting to run
tests / ci (8.3) (push) Has been cancelled
tests / ci (8.4) (push) Has been cancelled
tests / ci (8.5) (push) Has been cancelled
feat: implement presigned upload functionality for S3 in PresignedUploadController; update media upload handling across various components to support S3 keys and improve user experience
2026-07-02 14:28:51 +07:00

56 lines
1.6 KiB
PHP

<?php
namespace App\Http\Requests\Admin\System\Setting;
use App\Enums\Permission;
use App\Rules\PhoneNumber;
use Illuminate\Foundation\Http\FormRequest;
class SystemRequest extends FormRequest
{
public function authorize(): bool
{
return $this->user()?->can(Permission::SETTINGS_UPDATE->value) ?? false;
}
/**
* @return array<string, mixed>
*/
public function rules(): array
{
return [
'app_name' => ['required', 'string', 'max:100'],
'about_app' => ['required', 'string'],
'email' => ['required', 'email', 'max:100'],
'phone' => ['required', 'string', 'max:20', new PhoneNumber],
'address' => ['required', 'string'],
'logo' => ['nullable', 'image', 'max:2048'],
'logo_s3_key' => ['nullable', 'string'],
'favicon' => ['nullable', 'image', 'max:1024'],
'favicon_s3_key' => ['nullable', 'string'],
'login_cover' => ['nullable', 'image', 'max:5120'],
'login_cover_s3_key' => ['nullable', 'string'],
];
}
/**
* @return array<string, string>
*/
public function attributes(): array
{
return [
'app_name' => 'nama aplikasi',
'about_app' => 'tentang aplikasi',
'email' => 'email',
'phone' => 'nomor telepon',
'address' => 'alamat',
'logo' => 'logo',
'logo_s3_key' => 'logo',
'favicon' => 'favicon',
'favicon_s3_key' => 'favicon',
'login_cover' => 'cover login',
'login_cover_s3_key' => 'cover login',
];
}
}