A helper function to create breadcrums for you website
faisalahsanse/laravel-breadcrums is a Laravel package for a helper function to create breadcrums for you website.
It currently has 2 GitHub stars and 16 downloads on Packagist (latest version 1.1.0).
Install it with composer require faisalahsanse/laravel-breadcrums.
Discover more Laravel packages by faisalahsanse
or browse all Laravel packages to compare alternatives.
Last updated
A laravel breadcrums that will automatically generate the navigation breadcrums that you will specify.
Perform the following operations in order to use this middleware
Run composer require faisalahsanse/laravel-breadcrums in your terminal
Add Service Provider
Open config/app.php and add Faisalahsan\Breadcrums\BreadcumsServiceProvider::class to the end of providers array:
'providers' => array(
....
Faisalahsan\Breadcrums\BreadcumsServiceProvider::class,
),
Create a section breadcrums in your master layout (or whatever you are using)
**blade template**
@section('breadcrums')
@show
Extend your page with your master layout, in which you want to show breadcrums and define an array of breadcrums.
@extends('layouts.master')
@section('breadcrums')
{{-- */
$breadcrumbLinks =[ 'currentPageDisplayName' => 'My Current Page',
'breadcrumbLinks' => [ 'mySecondPageRouteName' => 'Previous Second Page',
'myFirstPageRouteName' => 'Previous First Page',
...
]];
/* --}}
{{ breadcrums( $breadcrumbLinks )}}
@show
Use routes without parameters
section('breadcrums')
{{-- */
$breadcrumbLinks =[ 'currentPageDisplayName' => 'My Current Page',
'breadcrumbLinks' => [ 'mySecondPageRouteName' => 'Previous Second Page',
'myFirstPageRouteName' => 'Previous First Page',
...
]];
/* --}}
{{ breadcrums( $breadcrumbLinks )}}
@show
Use routes parameters
section('breadcrums')
{{-- */
$breadcrumbLinks =[ 'currentPageDisplayName' => 'My Current Page',
'breadcrumbLinks' => [ 'mySecondPageRouteName' => 'Previous Second Page',
'myFirstPageRouteName' => 'Previous First Page',
'myRouteWithParameters' => [ 'routedDisplayName' => 'Route With Parameter',
'routedParameters' =>['firstParamName' => 'firstParamValue',
'secondParamName' => 'secondParamValue',
....
]]
...
]];
/* --}}
{{ breadcrums( $breadcrumbLinks )}}
@show
Customize style of breadcrums navigation
*breadcrumb** class define html tag **ul**
*breadcrumb-item** class define html tag **li*8 of **ul**