'array', 'rating' => 'float', 'price' => 'integer', 'reviews'=> 'integer', ]; protected static function booted(): void { static::deleting(function ($offer) { Storage::disk('public')->deleteDirectory("offers/{$offer->id}"); }); } public function getCoverImageUrlAttribute(): ?string { return $this->cover_image ? Storage::disk('public')->url($this->cover_image) : null; } public function schedules() { return $this->hasMany(CourseSchedule::class, 'diving_offer_id'); } public function courseImages() { return $this->hasMany(CourseImage::class)->orderBy('sort_order'); } public function reviews() { return $this->hasMany(Review::class); } }