45 lines
1.3 KiB
PHP
45 lines
1.3 KiB
PHP
<?php
|
||
|
||
namespace App\Http\Requests\HeroSlide;
|
||
|
||
use Illuminate\Foundation\Http\FormRequest;
|
||
|
||
class StoreHeroSlideRequest extends FormRequest
|
||
{
|
||
public function authorize(): bool
|
||
{
|
||
return true;
|
||
}
|
||
|
||
/**
|
||
* @return array<string, array<int, string>>
|
||
*/
|
||
public function rules(): array
|
||
{
|
||
return [
|
||
'label' => ['nullable', 'string', 'max:255'],
|
||
'title' => ['required', 'string', 'max:255'],
|
||
'description' => ['nullable', 'string'],
|
||
'media_type' => ['sometimes', 'string', 'in:image,video'],
|
||
'image' => ['nullable', 'string', 'max:255'],
|
||
'video_url' => ['nullable', 'string', 'max:255'],
|
||
'mobile_video_url' => ['nullable', 'string', 'max:255'],
|
||
'mobile_image' => ['nullable', 'string', 'max:255'],
|
||
'button_text' => ['nullable', 'string', 'max:100'],
|
||
'button_url' => ['nullable', 'string', 'max:255'],
|
||
'order_index' => ['sometimes', 'integer', 'min:0'],
|
||
'is_active' => ['sometimes', 'boolean'],
|
||
];
|
||
}
|
||
|
||
/**
|
||
* @return array<string, string>
|
||
*/
|
||
public function messages(): array
|
||
{
|
||
return [
|
||
'title.required' => 'Başlık zorunludur.',
|
||
];
|
||
}
|
||
}
|