Added Notifications

This commit is contained in:
2026-06-06 13:00:47 +10:00
parent a6812ad95c
commit 0f12250644
2 changed files with 6 additions and 1 deletions
@@ -28,7 +28,9 @@ class FlightFeedUpdate extends Command
*/ */
private function logFlightActions(string $type, Collection $flights): void private function logFlightActions(string $type, Collection $flights): void
{ {
foreach ($flights as $flight) { foreach ($flights as $flight) {
UserAction::create([ UserAction::create([
'user_id' => $flight->user_id, 'user_id' => $flight->user_id,
'type' => $type, 'type' => $type,
@@ -36,6 +38,10 @@ class FlightFeedUpdate extends Command
'flight' => $flight->snapshot($flight->id), 'flight' => $flight->snapshot($flight->id),
] ]
]); ]);
if($type === 'flight_departing'){
$flight->user->calculateAchievements();
}
} }
} }
} }
-1
View File
@@ -12,7 +12,6 @@ trait HasAchievements
{ {
public function calculateAchievements(): void public function calculateAchievements(): void
{ {
/** @var User $this */
app(AchievementService::class)->calculate($this); app(AchievementService::class)->calculate($this);
} }
} }