feat: reviews

This commit is contained in:
2026-05-18 21:46:54 +02:00
parent bb409610a8
commit 67d838fa65
8 changed files with 358 additions and 2 deletions
+23
View File
@@ -0,0 +1,23 @@
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class PostReviewsRequest extends FormRequest
{
public function rules(): array
{
$isCreating = $this->isMethod('post');
return [
'rating' => [$isCreating ? 'required' : 'sometimes', 'integer', 'min:1', 'max:5'],
'comment' => ['sometimes', 'nullable', 'string', 'max:1000'],
];
}
public function authorize(): bool
{
return true;
}
}