Skip to content

brnbio/laravel-breadcrumbs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

laravel-breadcrumbs

Breadcrumb helper for laravel

Usage

You can easily define any breadcrumbs in templates, layouts and controllers. There are 2 ways to add breadcrumbs: with the breadcrumb helper function or a blade directive.

helper function

Add breadcrumbs

breadcrumbs()->add('Items', route('index'));
breadcrumbs()->add('Item detail');

You can also prepend breadcrumbs for e.g. the home link in any layout

breadcrumbs()->prepend('Home', '/');

// with icon:
// because breadcrumb text is always escaped
// you have to add escape=false
breadcrumbs()->prepend('<i class="fa fas-home" />', route('home'), ['escape' => false]);

Render breadcrumbs

breadcrumbs()->render();

blade

same examples in blade

@breadcrumb('Home', '/')
@breadcrumb('Items', route('index'))
@breadcrumb('Item detail')

@section('content')
    
    @breadcrumbs()

@endsection

About

Breadcrumb helper for laravel

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages