feat: update models and relationships
This commit is contained in:
+11
-6
@@ -13,7 +13,7 @@ use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
/**
|
||||
* Class City
|
||||
*
|
||||
*
|
||||
* @property int $id
|
||||
* @property int $county_id
|
||||
* @property int $province_id
|
||||
@@ -22,7 +22,7 @@ use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
* @property Carbon $created_at
|
||||
* @property Carbon $updated_at
|
||||
* @property string|null $deleted_at
|
||||
*
|
||||
*
|
||||
* @property Country $country
|
||||
* @property Province $province
|
||||
* @property Collection|Airport[] $airports
|
||||
@@ -65,10 +65,15 @@ class City extends Model
|
||||
return $this->hasMany(Airport::class);
|
||||
}
|
||||
|
||||
public function tours()
|
||||
{
|
||||
return $this->hasMany(Tour::class, 'destination_city_id');
|
||||
}
|
||||
public function destinationTours()
|
||||
{
|
||||
return $this->hasMany(Tour::class, 'destination_city_id');
|
||||
}
|
||||
|
||||
public function originTours()
|
||||
{
|
||||
return $this->hasMany(Tour::class, 'origin_city_id');
|
||||
}
|
||||
|
||||
public function users()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user