feat: add tour enums, update Tour model, and create TourImage relation

This commit is contained in:
2026-08-20 11:58:45 +03:30
parent 3867350331
commit 021a66cfc9
5 changed files with 133 additions and 9 deletions
+53
View File
@@ -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);
}
}