85 lines
1.5 KiB
PHP
85 lines
1.5 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 $descriptions
|
|
* @property int $file_id
|
|
* @property string $origin
|
|
* @property string $destination
|
|
* @property int $duration
|
|
* @property int $status
|
|
* @property Carbon $created_at
|
|
* @property Carbon $updated_at
|
|
*
|
|
* @property File $file
|
|
* @property Collection|Comment[] $comments
|
|
* @property Collection|Favorite[] $favorites
|
|
* @property Collection|TourDate[] $tourDates
|
|
*
|
|
* @package App\Models
|
|
*/
|
|
class Tour extends Model
|
|
{
|
|
protected $table = 'tours';
|
|
public $timestamps = false;
|
|
|
|
public static $snakeAttributes = false;
|
|
|
|
protected $casts = [
|
|
'file_id' => 'int',
|
|
'duration' => 'int',
|
|
'price' => 'int',
|
|
'status' => 'int',
|
|
'created_at' => 'datetime',
|
|
'views' => 'int',
|
|
];
|
|
|
|
protected $fillable = [
|
|
'title',
|
|
'summary',
|
|
'descriptions',
|
|
'file_id',
|
|
'origin',
|
|
'destination',
|
|
'duration',
|
|
'price',
|
|
'views',
|
|
'status',
|
|
'created_at'
|
|
];
|
|
|
|
public function file()
|
|
{
|
|
return $this->belongsTo(File::class);
|
|
}
|
|
|
|
public function comments()
|
|
{
|
|
return $this->hasMany(Comment::class);
|
|
}
|
|
|
|
public function favorites()
|
|
{
|
|
return $this->hasMany(Favorite::class);
|
|
}
|
|
|
|
public function tourDates()
|
|
{
|
|
return $this->hasMany(TourDate::class);
|
|
}
|
|
}
|