Added Notifications
This commit is contained in:
@@ -28,7 +28,9 @@ class FlightFeedUpdate extends Command
|
||||
*/
|
||||
private function logFlightActions(string $type, Collection $flights): void
|
||||
{
|
||||
|
||||
foreach ($flights as $flight) {
|
||||
|
||||
UserAction::create([
|
||||
'user_id' => $flight->user_id,
|
||||
'type' => $type,
|
||||
@@ -36,6 +38,10 @@ class FlightFeedUpdate extends Command
|
||||
'flight' => $flight->snapshot($flight->id),
|
||||
]
|
||||
]);
|
||||
|
||||
if($type === 'flight_departing'){
|
||||
$flight->user->calculateAchievements();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,6 @@ trait HasAchievements
|
||||
{
|
||||
public function calculateAchievements(): void
|
||||
{
|
||||
/** @var User $this */
|
||||
app(AchievementService::class)->calculate($this);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user