git commit "add comments and fix tour comments display"
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use Illuminate\Contracts\Validation\ValidationRule;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class CommentStoreRequest 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 [
|
||||
'tour_id' => [
|
||||
'nullable',
|
||||
'exists:tours,id',
|
||||
'required_without:flight_id',
|
||||
],
|
||||
|
||||
'flight_id' => [
|
||||
'nullable',
|
||||
'exists:flights,id',
|
||||
'required_without:tour_id',
|
||||
],
|
||||
|
||||
'rating' => [
|
||||
'required',
|
||||
'integer',
|
||||
'min:1',
|
||||
'max:5',
|
||||
],
|
||||
|
||||
'comment' => [
|
||||
'nullable',
|
||||
'string',
|
||||
'max:1000',
|
||||
],
|
||||
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user