*/ protected $casts = [ 'active' => 'boolean', ]; /** * Booted */ protected static function booted(): void { static::deleted(function ($model) { if ($model->image) { Storage::disk('public')->delete($model->image); } }); } /** * Image url */ public function imageUrl(): string { return url('/storage/' . $this->image); } }