fix:edit models

This commit is contained in:
2026-08-17 13:13:45 -07:00
parent 5e61ca4289
commit 571c933476
5 changed files with 54 additions and 20 deletions
+11 -5
View File
@@ -12,7 +12,7 @@ use Illuminate\Database\Eloquent\Model;
/**
* Class Tour
*
*
* @property int $id
* @property string $title
* @property string $summary
@@ -22,9 +22,9 @@ use Illuminate\Database\Eloquent\Model;
* @property int|null $file_id
* @property int $duration
* @property int $status
* @property Carbon $created_ar
* @property Carbon $created_at
* @property Carbon $updated_at
*
*
* @property File|null $file
* @property Collection|TourDate[] $tour_dates
*
@@ -38,8 +38,9 @@ class Tour extends Model
protected $casts = [
'file_id' => 'int',
'duration' => 'int',
'views' => 'int',
'status' => 'int',
'created_ar' => 'datetime'
'created_at' => 'datetime'
];
protected $fillable = [
@@ -50,8 +51,9 @@ class Tour extends Model
'destination',
'file_id',
'duration',
'views',
'status',
'created_ar'
'created_at'
];
public function file()
@@ -63,4 +65,8 @@ class Tour extends Model
{
return $this->hasMany(TourDate::class);
}
public function comments()
{
return $this->hasMany(Comment::class, 'tour_id');
}
}