refactor: update models relations
This commit is contained in:
@@ -25,6 +25,7 @@ use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
*
|
||||
* @property Country $country
|
||||
* @property Province $province
|
||||
* @property Collection|Airport[] $airports
|
||||
* @property Collection|Tour[] $tours
|
||||
* @property Collection|User[] $users
|
||||
*
|
||||
@@ -59,6 +60,11 @@ class City extends Model
|
||||
return $this->belongsTo(Province::class);
|
||||
}
|
||||
|
||||
public function airports()
|
||||
{
|
||||
return $this->hasMany(Airport::class);
|
||||
}
|
||||
|
||||
public function tours()
|
||||
{
|
||||
return $this->hasMany(Tour::class, 'destination_city_id');
|
||||
|
||||
Reference in New Issue
Block a user