fix:change models problems and routes
This commit is contained in:
+11
-6
@@ -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()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user