Download the PHP package snetty/laravel-simple-breadcrumbs without Composer
On this page you can find all versions of the php package snetty/laravel-simple-breadcrumbs. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download snetty/laravel-simple-breadcrumbs
More information about snetty/laravel-simple-breadcrumbs
Files in snetty/laravel-simple-breadcrumbs
Package laravel-simple-breadcrumbs
Short Description A simple Laravel-style way to create breadcrumbs in Laravel 5+.
License MIT
Homepage https://github.com/snetty/laravel-simple-breadcrumbs
Informations about the package laravel-simple-breadcrumbs
################################################################################ Laravel Simple Breadcrumbs ################################################################################
An uber simple, "collection" style way to create breadcrumbs in Laravel 5.1.
Installation
composer require snetty/laravel-simple-breadcrumbs
php artisan vendor:publish
- Add
'Snetty\LaravelSimpleBreadcrumbs\ServiceProvider'
to your service providers in/config/app.php
- Type hint the class in your controller
public function index(Request $request, Breadcrumbs $breadcrumbs)
- Pass the object to your view
return view('sites.index', compact('sites', 'breadcrumbs'));
- Render the object
{!! $breadcrumbs->render() !!}
Usage
Breadcrumbs are added to your controllers like this: $breadcrumbs->add('/the/url', 'The Link Name');
,
or you can add multiple at once like this: $breadcrumbs->add(['/your-url' => 'Your Title', '/another/url'
=> 'Another Title']);
.
It is suggested that you add your index breadcrumb in the controller.