Added About Page

This commit is contained in:
2025-09-18 17:41:24 +10:00
parent 3a5f5ff0b7
commit ee1436c6f0
12 changed files with 161 additions and 8 deletions

View File

@@ -15,9 +15,15 @@ class Tour extends Model
return $this->belongsToMany(Country::class, 'tour_countries', 'tour_id', 'country_id');
}
public function tour_days()
{
return $this->hasMany(TourDay::class);
}
public static function featuredTours(){
return Tour::whereHas('countries.continent')
->with('countries.continent')
->with('tour_days')
->inRandomOrder()
->limit(4)
->get();

26
app/Models/TourDay.php Normal file
View File

@@ -0,0 +1,26 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class TourDay extends Model
{
use HasFactory;
protected $table = 'tour_days';
protected $fillable = [
'tour_id',
'description',
'content',
'image',
];
// Relationships
public function tour(): \Illuminate\Database\Eloquent\Relations\BelongsTo
{
return $this->belongsTo(Tour::class);
}
}