- Introduced routes for managing admin settings including system, homepage, social media, marketplace, and HR settings. - Created a comprehensive test suite for the AdminSettingsController to ensure proper functionality and validation of settings updates. - Implemented tests for authentication, data integrity, and realistic user scenarios to validate the settings management process.
33 lines
783 B
PHP
33 lines
783 B
PHP
<?php
|
|
|
|
namespace App\Http\Requests\Admin\Settings;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
class UpdateHomepageRequest extends FormRequest
|
|
{
|
|
public function authorize(): bool
|
|
{
|
|
return true;
|
|
}
|
|
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'hero_image_url' => ['nullable', 'string', 'max:2000'],
|
|
'about_image_url' => ['nullable', 'string', 'max:2000'],
|
|
'gallery_images' => ['nullable', 'array'],
|
|
'gallery_images.*' => ['string', 'max:2000'],
|
|
];
|
|
}
|
|
|
|
public function attributes(): array
|
|
{
|
|
return [
|
|
'hero_image_url' => 'url foto hero',
|
|
'about_image_url' => 'url foto tentang kami',
|
|
'gallery_images' => 'gambar galeri',
|
|
];
|
|
}
|
|
}
|