Skip to content

Instantly share code, notes, and snippets.

@brkphp
Last active June 9, 2021 15:57
Show Gist options
  • Save brkphp/5ae458ca92a79fbcd125e630b0c2290c to your computer and use it in GitHub Desktop.
Save brkphp/5ae458ca92a79fbcd125e630b0c2290c to your computer and use it in GitHub Desktop.
Laravel 5 simple breadcumbs
@php
$link = url('/');
@endphp
@for($i = 1; $i <= count(\Illuminate\Support\Facades\Request::segments()); $i++)
<li class="breadcrumb-item">
@if($i < count(\Illuminate\Support\Facades\Request::segments()) & $i > 0) <?php $link .= "/" . \Illuminate\Support\Facades\Request::segment($i); ?>
<a href="<?= $link ?>">{{\Illuminate\Support\Facades\Request::segment($i)}}</a> {!!'<i class="fa fa-angle-right"></i>'!!} @else {{\Illuminate\Support\Facades\Request::segment($i)}} @endif
</li>
@endfor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment