Added native os notifications

This commit is contained in:
2026-07-02 15:57:57 +10:00
parent 027437dc9b
commit 4c98b33fb4
4 changed files with 15 additions and 8 deletions
@@ -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
]);
}
}
);
});
}
}