fix:change models problems and routes

This commit is contained in:
2026-08-16 16:55:08 +03:30
parent 05bec33988
commit d0bb8e5413
6 changed files with 161 additions and 259 deletions
+11 -6
View File
@@ -12,7 +12,7 @@ use Illuminate\Database\Eloquent\Model;
/**
* Class Flight
*
*
* @property int $id
* @property int $arrival_aiport_id
* @property int $departure_airport_id
@@ -27,7 +27,7 @@ use Illuminate\Database\Eloquent\Model;
* @property int $status
* @property Carbon $created_at
* @property Carbon $updated_at
*
*
* @property Airline $airline
* @property File $file
* @property Airport $airport
@@ -72,16 +72,21 @@ class Flight extends Model
{
return $this->belongsTo(Airline::class);
}
public function departureAirport()
{
return $this->belongsTo(Airport::class, 'departure_airport_id');
}
public function arrivalAirport()
{
return $this->belongsTo(Airport::class, 'arrival_aiport_id');
}
public function file()
{
return $this->belongsTo(File::class);
}
public function airport()
{
return $this->belongsTo(Airport::class, 'departure_airport_id');
}
public function bookings()
{