56 lines
893 B
PHP
56 lines
893 B
PHP
<?php
|
|
|
|
/**
|
|
* Created by Reliese Model.
|
|
*/
|
|
|
|
namespace App\Models;
|
|
|
|
use Carbon\Carbon;
|
|
use Illuminate\Database\Eloquent\Collection;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
/**
|
|
* Class Tour
|
|
*
|
|
* @property int $id
|
|
* @property string $title
|
|
* @property int $file_id
|
|
* @property string $tour_type
|
|
* @property string $summary
|
|
* @property string $description
|
|
* @property Carbon $created_at
|
|
* @property Carbon $updated_at
|
|
*
|
|
* @property File $file
|
|
* @property Collection|TourDetail[] $tour_details
|
|
*
|
|
* @package App\Models
|
|
*/
|
|
class Tour extends Model
|
|
{
|
|
protected $table = 'tours';
|
|
|
|
protected $casts = [
|
|
'file_id' => 'int'
|
|
];
|
|
|
|
protected $fillable = [
|
|
'title',
|
|
'file_id',
|
|
'tour_type',
|
|
'summary',
|
|
'description'
|
|
];
|
|
|
|
public function file()
|
|
{
|
|
return $this->belongsTo(File::class);
|
|
}
|
|
|
|
public function tour_details()
|
|
{
|
|
return $this->hasMany(TourDetail::class);
|
|
}
|
|
}
|