feat: update models and relationships
This commit is contained in:
+12
-3
@@ -12,7 +12,7 @@ use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class Tour
|
||||
*
|
||||
*
|
||||
* @property int $id
|
||||
* @property string $title
|
||||
* @property string $summary
|
||||
@@ -23,7 +23,7 @@ use Illuminate\Database\Eloquent\Model;
|
||||
* @property string $tour_type
|
||||
* @property Carbon $created_at
|
||||
* @property Carbon $updated_at
|
||||
*
|
||||
*
|
||||
* @property Flight $flight
|
||||
* @property City $city
|
||||
* @property Collection|TourDeparture[] $tourDepartures
|
||||
@@ -55,6 +55,10 @@ class Tour extends Model
|
||||
{
|
||||
return $this->belongsTo(Flight::class, 'file_id');
|
||||
}
|
||||
public function originCity()
|
||||
{
|
||||
return $this->belongsTo(City::class, 'origin_city_id');
|
||||
}
|
||||
|
||||
public function city()
|
||||
{
|
||||
@@ -63,6 +67,11 @@ class Tour extends Model
|
||||
|
||||
public function tourDepartures()
|
||||
{
|
||||
return $this->hasMany(TourDeparture::class);
|
||||
return $this->hasMany(TourDeparture::class , 'tour_id');
|
||||
}
|
||||
|
||||
public function file()
|
||||
{
|
||||
return $this->belongsTo(File::class, 'file_id');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user