2017 © Pedro Peláez
 

library laracrumbs

A light way of adding breadcrumbs to a route in Laravel

image

evomase/laracrumbs

A light way of adding breadcrumbs to a route in Laravel

  • Monday, July 24, 2017
  • by evomase
  • Repository
  • 0 Watchers
  • 0 Stars
  • 7 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Laracrumbs

Laracrumbs is a lightweight Laravel package that provides the functionality to add Breadcrumbs to Routes, (*1)

Requirements

  • PHP 7.0
  • Laravel 5.4+

Installation

To get started, install Laracrumbs via Composer, (*2)

composer require evomase/laracrumbs

Next, is to register the Laracrumbs service provider to the providers array of your config/app configuration file:, (*3)

Laracrumbs\Providers\ServiceProvider::class

Basic Usage

Register

Breadcrumbs are created by using the registered routes and defining a callback to return the title for each segment. The following example below shows how this can be done, (*4)

//Create Route
$route = Route::get('/', 'Controller@method');

//Add route to Breadcrumb
Breadcrumbs::add($route, function(){
    return 'Home';
});

All parameters assigned to a route will also be passed to the callback enabling you to customize the return value further. Also, objects in the service container are automatically injected in the callback as shown in the example below., (*5)

$route = Route::get('users/{user}/edit', 'Controller@method');
Breadcrumbs::add($route, function(App\User $user, Illuminate\Container $app){
   // return a string
});

Render

A breadcrumbs view has been added which can be included in any view template. Once included, it will automatically generate the breadcrumbs associated to the current request., (*6)

<div class="container">
    @include('laracrumbs::breadcrumbs')
</div>

A copy of the breadcrumbs views template can be found in resources\views\vendor, (*7)

License

Laracrumbs is open-sourced software licensed under the MIT license, (*8)

The Versions

24/07 2017

dev-master

9999999-dev

A light way of adding breadcrumbs to a route in Laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by David Ogilo

laravel route request breadcrumbs

22/05 2017

dev-unstable

dev-unstable

A light way of adding breadcrumbs to a route in Laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by David Ogilo

laravel route request breadcrumbs