Simple breadcrumbs with Blade & Request

Submitted by Dombo - 2 years ago

Iteratively display "page breadcrumbs" - ideal for a partial.

<ul class="page-breadcrumb">
<li>
	<i class="fa fa-home"></i>
	<a href="{{route('home')}}">Home</a>
	<i class="fa fa-angle-right"></i>
</li>
@for($i = 0; $i <= count(Request::segments()); $i++)
<li>
	<a href="">{{Request::segment($i)}}</a>
	@if($i < count(Request::segments()) & $i > 0)
		{!!'<i class="fa fa-angle-right"></i>'!!}
	@endif
</li>
@endfor
</ul>

Ads cover the costs of maintaining Laravel-tricks

comments powered by Disqus

Ads cover the costs of maintaining Laravel-tricks