Session api token validation
This commit is contained in:
@@ -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([
|
||||
|
||||
Reference in New Issue
Block a user