feat: add FlightImage model and update Flight image relation

This commit is contained in:
2026-08-20 12:17:34 +03:30
parent ff52b19e96
commit feeaf317cf
2 changed files with 64 additions and 0 deletions
+11
View File
@@ -156,5 +156,16 @@ class Flight extends Model
{
return $this->hasMany(Favorite::class);
}
public function images()
{
return $this->hasMany(FlightImage::class)
->orderBy('sort_order');
}
public function coverImage()
{
return $this->hasOne(FlightImage::class)
->where('is_default', true);
}
}