feat: display tours dynamically on index page
This commit is contained in:
+24
-6
@@ -12,17 +12,21 @@ use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class Tour
|
||||
*
|
||||
*
|
||||
* @property int $id
|
||||
* @property string $title
|
||||
* @property int $file_id
|
||||
* @property int|null $file_id
|
||||
* @property string $tour_type
|
||||
* @property string $summary
|
||||
* @property string $description
|
||||
* @property Carbon $created_at
|
||||
* @property Carbon $updated_at
|
||||
*
|
||||
* @property File $file
|
||||
* @property int $origin_airports_id
|
||||
* @property int $destination_airports_id
|
||||
*
|
||||
* @property Airport $originAirport
|
||||
* @property Airport $destinationAirport
|
||||
* @property File|null $file
|
||||
* @property Collection|TourDetail[] $tour_details
|
||||
*
|
||||
* @package App\Models
|
||||
@@ -32,7 +36,9 @@ class Tour extends Model
|
||||
protected $table = 'tours';
|
||||
|
||||
protected $casts = [
|
||||
'file_id' => 'int'
|
||||
'file_id' => 'int',
|
||||
'origin_airports_id' => 'int',
|
||||
'destination_airports_id' => 'int'
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
@@ -40,9 +46,21 @@ class Tour extends Model
|
||||
'file_id',
|
||||
'tour_type',
|
||||
'summary',
|
||||
'description'
|
||||
'description',
|
||||
'origin_airports_id',
|
||||
'destination_airports_id'
|
||||
];
|
||||
|
||||
public function originAirport()
|
||||
{
|
||||
return $this->belongsTo(Airport::class, 'origin_airports_id');
|
||||
}
|
||||
|
||||
public function destinationAirport()
|
||||
{
|
||||
return $this->belongsTo(Airport::class, 'destination_airports_id');
|
||||
}
|
||||
|
||||
public function file()
|
||||
{
|
||||
return $this->belongsTo(File::class);
|
||||
|
||||
Reference in New Issue
Block a user