@php
$rootCatId = null;
$curr = $annonce->category;
while($curr && $curr->parent_id) { $curr = $curr->parent; }
$rootCatId = $curr ? $curr->id : null;
$icons = [
'E-commerce' => '
',
'Services' => '
',
'Immobilier' => '
',
'Véhicules' => '
'
];
@endphp
@foreach($categories->where('parent_id', null) as $categorie)
@if($categorie->icone) {!! $categorie->icone !!}
@else {!! $icons[$categorie->nom] ?? '...' !!}
@endif
{{ $categorie->nom }}
@endforeach