2017 © Pedro Peláez
 

project breadcrumbs

Breadcrumb builder for Laravel and PHP applications.

image

jameron/breadcrumbs

Breadcrumb builder for Laravel and PHP applications.

  • Thursday, September 7, 2017
  • by Jameron
  • Repository
  • 1 Watchers
  • 0 Stars
  • 19 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 9 Versions
  • 6 % Grown

The README.md

Breadcrumb

I wrote this to use in Laravel applications, but kept it loosely coupled so it can be used in any PHP application. The example view file uses blade template syntax but can easily be translated to straight up php or other templating engine., (*1)

To use within Laravel:

To install run:, (*2)

composer require jameron/breadcrumbs, (*3)

Add to config/app.php, (*4)

add the service provider:, (*5)

'providers' => [
    // ...
    Jameron\Breadcrumb\Providers\BreadcrumbServiceProvider::class,
],

add the facade to the aliases:, (*6)

'aliases' => [
    // ...
    'Breadcrumb' => Jameron\Breadcrumb\Breadcrumb::class,
],

In your controller:, (*7)

use Breadcrumb;
use Illuminate\Http\Request;

class ResourceController extends Controller
{

    protected $home_route;

    public function __construct()
    {
        $this->home_route = ['title'=>'home','url'=>'/home'];
    }

    public function index(Request $request)
    {

        $breadcrumb = (new Breadcrumb($request->path(), $this->home_route))->build();

        return view('resource.index', compact('breadcrumb'));

    }
}

Include the view partial into your layout or view file where you want the breadcrumb to appear., (*8)

E.g. @include('partials.utils.breadcrumb', ['items' => $breadcrumb]), (*9)

in your breadcrumb partial add the following:, (*10)

<ol class="breadcrumb">
    @foreach($crumbs as $item)
        <li>@if(!$item['active'])<a href="{!! $item['url'] !!}"@if($item['active']) class="active"@endif>@endif{!! $item['title'] !!}@if(!$item['active'])</a>@endif</li>
    @endforeach
</ol>

License

This breadcrumb is open-sourced software licensed under the MIT license., (*11)

The Versions

07/09 2017

dev-master

9999999-dev http://cjmacfarlane.com

Breadcrumb builder for Laravel and PHP applications.

  Sources   Download

MIT

The Development Requires

by Cameron Macfarlane

laravel php breadcrumb

17/07 2017

1.0.5

1.0.5.0 http://cjmacfarlane.com

Breadcrumb builder for Laravel and PHP applications.

  Sources   Download

MIT

The Development Requires

by Cameron Macfarlane

laravel php breadcrumb

17/07 2017

1.0.6

1.0.6.0 http://cjmacfarlane.com

Breadcrumb builder for Laravel and PHP applications.

  Sources   Download

MIT

The Development Requires

by Cameron Macfarlane

laravel php breadcrumb

17/07 2017

1.0.7

1.0.7.0 http://cjmacfarlane.com

Breadcrumb builder for Laravel and PHP applications.

  Sources   Download

MIT

The Development Requires

by Cameron Macfarlane

laravel php breadcrumb

15/07 2017

1.0.4

1.0.4.0 http://cjmacfarlane.com

Breadcrumb builder for PHP applications.

  Sources   Download

MIT

The Development Requires

by Cameron Macfarlane

laravel php breadcrumb

15/07 2017

1.0.3

1.0.3.0 http://cjmacfarlane.com

Breadcrumb builder for PHP applications.

  Sources   Download

MIT

The Development Requires

by Cameron Macfarlane

laravel php breadcrumb

14/07 2017

1.0.2

1.0.2.0 http://cjmacfarlane.com

Breadcrumb builder for PHP applications.

  Sources   Download

MIT

The Development Requires

by Cameron Macfarlane

laravel php breadcrumb

14/07 2017

1.0.1

1.0.1.0 http://cjmacfarlane.com

Breadcrumb builder for PHP applications.

  Sources   Download

MIT

The Development Requires

by Cameron Macfarlane

laravel php breadcrumb

12/07 2017

1.0.0

1.0.0.0 http://cjmacfarlane.com

Breadcrumb builder for PHP applications.

  Sources   Download

MIT

The Development Requires

by Cameron Macfarlane

laravel php breadcrumb