66 lines
1.2 KiB
PHP
66 lines
1.2 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 $image
|
|
* @property string $views
|
|
* @property int $travel_type_id
|
|
* @property float $price
|
|
* @property Carbon $departure_date
|
|
* @property int $status
|
|
* @property Carbon $created_at
|
|
* @property Carbon $updated_at
|
|
*
|
|
* @property Collection|Comment[] $comments
|
|
*
|
|
* @package App\Models
|
|
*/
|
|
class Tour extends Model
|
|
{
|
|
protected $table = 'tours';
|
|
public static $snakeAttributes = false;
|
|
|
|
protected $casts = [
|
|
'travel_type_id' => 'int',
|
|
'price' => 'float',
|
|
'departure_date' => 'datetime',
|
|
'status' => 'int'
|
|
];
|
|
|
|
protected $fillable = [
|
|
'title',
|
|
'summary',
|
|
'description',
|
|
'image',
|
|
'views',
|
|
'travel_type_id',
|
|
'price',
|
|
'departure_date',
|
|
'status'
|
|
];
|
|
|
|
public function comments()
|
|
{
|
|
return $this->hasMany(Comment::class);
|
|
}
|
|
public function travelType()
|
|
{
|
|
return $this->belongsTo(TravelType::class);
|
|
}
|
|
}
|