Files

67 lines
1.4 KiB
PHP

<?php
namespace App\Http\Requests\Tours;
use Illuminate\Contracts\Validation\ValidationRule;
use Illuminate\Foundation\Http\FormRequest;
class TourUpdatePostRequest 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',
'min:3',
'max:150',
],
'file_id' => [
'nullable',
'exists:files,id',
],
'tour_type' => [
'required',
'string',
'max:255',
],
'summary' => [
'required',
'string',
],
'description' => [
'required',
'string',
],
'origin_airports_id' => [
'required',
'exists:airports,id',
],
'destination_airports_id' => [
'required',
'exists:airports,id',
],
];
}
}