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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
namespace App\Providers;
|
||||
|
||||
use App\Models\Continent;
|
||||
use Illuminate\Support\Facades\URL;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Inertia\Inertia;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user