feat: add comments for controller and model and blade for dashboard for user

This commit is contained in:
2026-08-18 14:26:23 +03:30
parent 5c1af64281
commit 7cd7c804ec
4 changed files with 175 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class CommentPostRequest extends FormRequest
{
public function authorize(): bool
{
return true;
}
public function rules(): array
{
$rules = [
'commentable_id' => 'required|integer',
'commentable_type' => 'required|string|in:tour,flight',
'body' => 'required|string|max:1000',
];
if (!auth()->check()) {
$rules['guest_name'] = 'required|string|max:150';
}
return $rules;
}
}