Session api token validation

This commit is contained in:
2026-06-29 21:42:47 +10:00
parent 164b590a6c
commit e551e202d5
18 changed files with 273 additions and 154 deletions
+14
View File
@@ -182,6 +182,20 @@ class UserFlight extends Model
return !$this->isDomestic();
}
public function otherUsersOnFlight(){
return UserFlight::where('user_id', '!=', $this->user_id)
->where('departure_airport_id', $this->departure_airport_id)
->where('arrival_airport_id', $this->arrival_airport_id)
->where('flight_number', $this->flight_number)
->where('airline_id', $this->airline_id)
->whereRaw('DATE(departure_date AT TIME ZONE \'UTC\') = ?', [
Carbon::parse($this->departure_date)->utc()->toDateString()
])
->with('user')
->get()
->pluck('user.name');
}
public static function snapshot($userFlightId): array
{
return UserFlight::with([