Componentalization
This commit is contained in:
@@ -14,4 +14,10 @@ class Tour extends Model
|
||||
{
|
||||
return $this->belongsToMany(Country::class, 'tour_countries', 'tour_id', 'country_id');
|
||||
}
|
||||
|
||||
public static function featuredTours(){
|
||||
return Tour::whereHas('countries.continent')
|
||||
->with('countries.continent')
|
||||
->get();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user