Added native os notifications
This commit is contained in:
@@ -32,6 +32,7 @@ class UpdateDepartedFlights extends Command
|
||||
|
||||
foreach ($userFlights as $flight) {
|
||||
$flight->update(['departure_processed_at' => $now]);
|
||||
$this->notifyFollowersOnDeparture($flight);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,7 +42,10 @@ class UpdateDepartedFlights extends Command
|
||||
$title = "{$user->name} is taking off!";
|
||||
$flightNumber = $flight->flight_number ? "On {$flight->flight_number} from" : 'From';
|
||||
$body = "{$flightNumber} {$flight->departureAirport->municipality} → {$flight->arrivalAirport->municipality}";
|
||||
$url = route('profile.flight', [$flight->id]);
|
||||
$url = route('profile.flight', [
|
||||
'user' => $user->id,
|
||||
'userFlight' => $flight->id,
|
||||
]);
|
||||
|
||||
$user->followers()->get()->each(function (User $follower) use ($title, $body, $url) {
|
||||
$notify = $follower->getSetting('notify_on_flight_departure');
|
||||
@@ -55,7 +59,6 @@ class UpdateDepartedFlights extends Command
|
||||
]);
|
||||
}
|
||||
|
||||
}
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user