fix: update tour management

This commit is contained in:
2026-08-17 19:53:12 +03:30
parent 81d2aa1acb
commit 123b43fb38
7 changed files with 358 additions and 29 deletions
+18 -7
View File
@@ -38,12 +38,17 @@ class Tour extends Model
public static $snakeAttributes = false;
protected $casts = [
'travel_type_id' => 'int',
'start_date' => 'datetime',
'end_date' => 'datetime',
'price' => 'float',
'capacity' => 'int',
'status' => 'int'
'start_date' => 'date',
'end_date' => 'date',
'price' => 'decimal:2',
'status' => 'integer',
// 'travel_type_id' => 'int',
// 'start_date' => 'datetime',
// 'end_date' => 'datetime',
// 'price' => 'float',
// 'capacity' => 'int',
// 'status' => 'int'
];
protected $fillable = [
@@ -56,7 +61,8 @@ class Tour extends Model
'end_date',
'price',
'capacity',
'status'
'status',
'image',
];
public function travelType()
@@ -93,5 +99,10 @@ class Tour extends Model
return 'slug';
}
public function getStatusLabelAttribute()
{
return $this->status == 1 ? 'فعال' : 'پیش‌نویس';
}
}