*/ use HasFactory; use HasPublication; protected static function booted(): void { static::saving(function (PortfolioCase $portfolioCase): void { if (blank($portfolioCase->slug) && filled($portfolioCase->title)) { $portfolioCase->slug = Str::slug($portfolioCase->title); } }); } /** * @return HasMany */ public function images(): HasMany { return $this->hasMany(PortfolioImage::class)->orderBy('sort_order'); } /** * @return array */ protected function casts(): array { return [ 'is_featured' => 'boolean', 'published_at' => 'datetime', 'event_date' => 'date', 'sort_order' => 'integer', ]; } }