feat: display tours dynamically on index page

This commit is contained in:
2026-08-16 16:58:45 +03:30
parent 374c96bb79
commit 95cc970b07
9 changed files with 114 additions and 233 deletions
+13 -2
View File
@@ -12,15 +12,16 @@ use Illuminate\Database\Eloquent\Model;
/**
* Class Airport
*
*
* @property int $id
* @property string $name
* @property string $city
* @property string $country
* @property Carbon $created_at
* @property Carbon $updated_at
*
*
* @property Collection|Flight[] $flights
* @property Collection|Tour[] $tours
*
* @package App\Models
*/
@@ -38,4 +39,14 @@ class Airport extends Model
{
return $this->hasMany(Flight::class, 'origin_airports_id');
}
public function originTours()
{
return $this->hasMany(Tour::class, 'origin_airports_id');
}
public function destinationTours()
{
return $this->hasMany(Tour::class, 'destination_airports_id');
}
}