67 lines
1.1 KiB
PHP
67 lines
1.1 KiB
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 string $summary
|
|
* @property string $description
|
|
* @property string $origin
|
|
* @property string $destination
|
|
* @property int|null $file_id
|
|
* @property int $duration
|
|
* @property int $status
|
|
* @property Carbon $created_ar
|
|
* @property Carbon $updated_at
|
|
*
|
|
* @property File|null $file
|
|
* @property Collection|TourDate[] $tour_dates
|
|
*
|
|
* @package App\Models
|
|
*/
|
|
class Tour extends Model
|
|
{
|
|
protected $table = 'tours';
|
|
public $timestamps = false;
|
|
|
|
protected $casts = [
|
|
'file_id' => 'int',
|
|
'duration' => 'int',
|
|
'status' => 'int',
|
|
'created_ar' => 'datetime'
|
|
];
|
|
|
|
protected $fillable = [
|
|
'title',
|
|
'summary',
|
|
'description',
|
|
'origin',
|
|
'destination',
|
|
'file_id',
|
|
'duration',
|
|
'status',
|
|
'created_ar'
|
|
];
|
|
|
|
public function file()
|
|
{
|
|
return $this->belongsTo(File::class);
|
|
}
|
|
|
|
public function tour_dates()
|
|
{
|
|
return $this->hasMany(TourDate::class);
|
|
}
|
|
}
|