/** * Check if the asset's SVG icon exists * * @return bool */ public function hasIcon(): bool { $iconPath = 'assets/img/icon/asset-' . str_replace(['/', '#'], '', $this->code) . '.svg'; return file_exists(public_path($iconPath)); }