39 lines
904 B
PHP
39 lines
904 B
PHP
<?php
|
||
|
||
namespace App\Http\Requests\GuideCard;
|
||
|
||
use Illuminate\Foundation\Http\FormRequest;
|
||
|
||
class StoreGuideCardRequest extends FormRequest
|
||
{
|
||
public function authorize(): bool
|
||
{
|
||
return true;
|
||
}
|
||
|
||
/**
|
||
* @return array<string, array<int, string>>
|
||
*/
|
||
public function rules(): array
|
||
{
|
||
return [
|
||
'title' => ['required', 'string', 'max:255'],
|
||
'description' => ['required', 'string', 'max:500'],
|
||
'icon' => ['nullable', 'string', 'max:100'],
|
||
'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.',
|
||
'description.required' => 'Açıklama zorunludur.',
|
||
];
|
||
}
|
||
}
|