80 lines
1.6 KiB
PHP
80 lines
1.6 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Requests\Admin\Tours;
|
|
|
|
use Illuminate\Contracts\Validation\ValidationRule;
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
class tourUpdateRequest 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',
|
|
'max:256',
|
|
],
|
|
|
|
'image' => [
|
|
'nullable',
|
|
'image',
|
|
'mimes:jpg,jpeg,png,webp',
|
|
'max:5120',
|
|
],
|
|
|
|
'summary' => [
|
|
'required',
|
|
'max:512',
|
|
],
|
|
|
|
'description' => [
|
|
'required',
|
|
],
|
|
|
|
'origin' => [
|
|
'required',
|
|
'max:200',
|
|
],
|
|
|
|
'destination' => [
|
|
'required',
|
|
'max:256',
|
|
],
|
|
|
|
'duration' => [
|
|
'required',
|
|
'integer',
|
|
'min:1',
|
|
],
|
|
'departure_time' => [
|
|
'required',
|
|
'date',
|
|
'after_or_equal:today',
|
|
],
|
|
|
|
'price' => [
|
|
'required',
|
|
'integer',
|
|
'min:0',
|
|
],
|
|
|
|
'status' => [
|
|
'required',
|
|
],
|
|
];
|
|
}
|
|
}
|