store/app/Http/Requests/Admin/System/Setting/HomepageSettingRequest.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

47 lines
1.3 KiB
PHP

<?php
namespace App\Http\Requests\Admin\System\Setting;
use App\Enums\Permission;
use Illuminate\Foundation\Http\FormRequest;
class HomepageSettingRequest extends FormRequest
{
public function authorize(): bool
{
return $this->user()?->can(Permission::SETTINGS_UPDATE->value) ?? false;
}
/**
* @return array<string, mixed>
*/
public function rules(): array
{
return [
'hero_image' => ['nullable', 'image', 'max:5120'],
'hero_image_s3_key' => ['nullable', 'string'],
'about_image' => ['nullable', 'image', 'max:5120'],
'about_image_s3_key' => ['nullable', 'string'],
'gallery_s3_keys' => ['nullable', 'array', 'max:10'],
'gallery_s3_keys.*' => ['required', 'string'],
'gallery_images_remove' => ['nullable', 'array'],
'gallery_images_remove.*' => ['integer'],
];
}
/**
* @return array<string, string>
*/
public function attributes(): array
{
return [
'hero_image' => 'Foto Hero',
'hero_image_s3_key' => 'Foto Hero',
'about_image' => 'Foto Tentang Kami',
'about_image_s3_key' => 'Foto Tentang Kami',
'gallery_s3_keys' => 'Foto Lookbook',
'gallery_s3_keys.*' => 'Foto Lookbook',
];
}
}