fa291c7108
git commit "complete tour and flight departure date handling"
91 lines
1.7 KiB
PHP
91 lines
1.7 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Requests;
|
|
|
|
use Illuminate\Contracts\Validation\ValidationRule;
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
class TourStoreRequest extends FormRequest
|
|
{
|
|
/**
|
|
* Determine if the user is authorized to make this request.
|
|
*/
|
|
public function authorize(): bool
|
|
{
|
|
return true;
|
|
}
|
|
/**
|
|
* Get the validation rules that apply to the request.
|
|
*
|
|
* @return array<string, ValidationRule|array<mixed>|string>
|
|
*/
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'title' => [
|
|
'required',
|
|
'string',
|
|
'max:255'
|
|
],
|
|
|
|
|
|
'summary' => [
|
|
'required',
|
|
'string',
|
|
'max:500'
|
|
],
|
|
|
|
|
|
'description' => [
|
|
'required',
|
|
'string'
|
|
],
|
|
|
|
|
|
'image' => [
|
|
'nullable',
|
|
'image',
|
|
'mimes:jpg,jpeg,png,webp',
|
|
'max:2048'
|
|
],
|
|
|
|
|
|
'views' => [
|
|
'nullable',
|
|
'integer',
|
|
'min:0'
|
|
],
|
|
|
|
|
|
'travel_type_id' => [
|
|
'required',
|
|
'integer'
|
|
],
|
|
|
|
|
|
'price' => [
|
|
'required',
|
|
'numeric',
|
|
'min:0'
|
|
],
|
|
|
|
'views'=>[
|
|
'nullable',
|
|
'integer',
|
|
'min:0'
|
|
],
|
|
|
|
'departure_date' => [
|
|
'required',
|
|
],
|
|
|
|
|
|
'status' => [
|
|
'required',
|
|
'integer',
|
|
'in:0,1,2,3,4'
|
|
]
|
|
];
|
|
}
|
|
}
|