public static function boot() { parent::boot(); Ad::deleting(function ($ad) { foreach ($ad->images as $image) { $image->delete(); } }); }