git commit "add comments and fix tour comments display"

This commit is contained in:
2026-08-17 13:33:37 +03:30
parent 970786ae94
commit 902384625b
11 changed files with 729 additions and 166 deletions
+53
View File
@@ -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',
],
];
}
}