feat: add tour enums, update Tour model, and create TourImage relation
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Created by Reliese Model.
|
||||
*/
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* Class TourImage
|
||||
*
|
||||
* @property int $id
|
||||
* @property int $tour_id
|
||||
* @property int $file_id
|
||||
* @property int|null $sort_order
|
||||
* @property bool|null $is_default
|
||||
* @property Carbon|null $created_at
|
||||
* @property Carbon|null $updated_at
|
||||
*
|
||||
* @package App\Models
|
||||
*/
|
||||
class TourImage extends Model
|
||||
{
|
||||
protected $table = 'tour_images';
|
||||
public static $snakeAttributes = false;
|
||||
|
||||
protected $casts = [
|
||||
'tour_id' => 'int',
|
||||
'file_id' => 'int',
|
||||
'sort_order' => 'int',
|
||||
'is_default' => 'bool'
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'tour_id',
|
||||
'file_id',
|
||||
'sort_order',
|
||||
'is_default'
|
||||
];
|
||||
|
||||
public function tour()
|
||||
{
|
||||
return $this->belongsTo(Tour::class);
|
||||
}
|
||||
|
||||
public function file()
|
||||
{
|
||||
return $this->belongsTo(File::class);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user