feat: display tours dynamically on index page
This commit is contained in:
+13
-2
@@ -12,15 +12,16 @@ use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class Airport
|
||||
*
|
||||
*
|
||||
* @property int $id
|
||||
* @property string $name
|
||||
* @property string $city
|
||||
* @property string $country
|
||||
* @property Carbon $created_at
|
||||
* @property Carbon $updated_at
|
||||
*
|
||||
*
|
||||
* @property Collection|Flight[] $flights
|
||||
* @property Collection|Tour[] $tours
|
||||
*
|
||||
* @package App\Models
|
||||
*/
|
||||
@@ -38,4 +39,14 @@ class Airport extends Model
|
||||
{
|
||||
return $this->hasMany(Flight::class, 'origin_airports_id');
|
||||
}
|
||||
|
||||
public function originTours()
|
||||
{
|
||||
return $this->hasMany(Tour::class, 'origin_airports_id');
|
||||
}
|
||||
|
||||
public function destinationTours()
|
||||
{
|
||||
return $this->hasMany(Tour::class, 'destination_airports_id');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user