feat: report reviews etc ...

This commit is contained in:
2026-05-23 12:15:11 +02:00
parent 49419c1e7b
commit 4af28f3828
15 changed files with 146 additions and 0 deletions
+7
View File
@@ -8,6 +8,7 @@ use App\Enums\ReportStatus;
use App\Enums\UserRole;
use App\Models\MealPosts;
use App\Models\ModerationCase;
use App\Models\PostReviews;
use App\Models\Report;
use App\Models\User;
use Filament\Notifications\Notification as FilamentNotification;
@@ -135,6 +136,12 @@ class ModerationReportService
422,
__('api.reports.cannot_report_own_meal'),
);
abort_if(
$reportable instanceof PostReviews && $reportable->user_id === $reporter->getKey(),
422,
__('api.reports.cannot_report_own_review'),
);
}
private function isDuplicateReportException(QueryException $exception): bool