We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b35c786 commit fe994a4Copy full SHA for fe994a4
app/Observers/TripObserver.php
@@ -3,20 +3,20 @@
3
namespace App\Observers;
4
5
use App\Enum\Report\ReportableSubject;
6
-use App\Enum\Report\ReportReason;
+use App\Enum\TripSource;
7
use App\Models\Trip;
8
-use App\Repositories\ReportRepository;
9
use App\Services\ReportService;
10
-use Illuminate\Support\Facades\Log;
11
12
class TripObserver
13
{
14
public function created(Trip $trip): void {
15
// check if trip is out of allowed types and create an admin report if so
16
- (new ReportService())->checkAndReport(
17
- $trip->linename,
18
- ReportableSubject::TRIP,
19
- $trip->id
20
- );
+ if ($trip->source === TripSource::USER) {
+ (new ReportService())->checkAndReport(
+ $trip->linename,
+ ReportableSubject::TRIP,
+ $trip->id
+ );
+ }
21
}
22
0 commit comments