feat: add created_by field handling for flights
This commit is contained in:
@@ -0,0 +1,92 @@
|
||||
<?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',
|
||||
'date',
|
||||
'after_or_equal:today',
|
||||
],
|
||||
|
||||
|
||||
'status' => [
|
||||
'required',
|
||||
'integer',
|
||||
'in:0,1,2,3,4'
|
||||
]
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user