2017 © Pedro Peláez
 

library laravel-breadcumb

PHP project.

image

mateusjatenee/laravel-breadcumb

PHP project.

  • Thursday, May 4, 2017
  • by mateusjatenee
  • Repository
  • 1 Watchers
  • 7 Stars
  • 18 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Laravel Breadcumbs

Build Status Latest Stable Version Total Downloads Latest Unstable Version License, (*1)

This package allows you to generate HTML for breadcumbs. Here's an example:, (*2)

Breadcrumb::generate('users.show')

results on this using the Bootstrap Driver, (*3)

<ol class="breadcrumb"><li><span>Users</span></li><li class="active"><span>Show</span></li></ol>, (*4)

You may write your own drivers. This will be documented soon., (*5)

Installation

This package can be installed through Composer., (*6)

``` bash $ composer require mateusjatenee/laravel-breadcrumbs, (*7)


Add the following service provider ```php // config/app.php 'providers' => [ ... Mateusjatenee\Breadcrumb\BreadcrumbServiceProvider::class, ... ];

This package also comes with a facade, which provides an easy way to call the the class., (*8)

// config/app.php
'aliases' => [
    ...
    'Breadcrumb' => Mateusjatenee\Breadcrumb\Facades\Breadcrumb::class,
    ...
];

You may register your drivers with the following code in a service provider's boot method, (*9)

Breadcumb::addDriver('driverName', DriverClass::class);

And you may switch the default driver with the following code, (*10)

Breadcumb::setDriver('driverName');

Writing Drivers

Writing a driver is pretty simple. You just have to create a class that extends Mateusjatenee\Breadcrumb\BreadcrumbGenerator and implements Mateusjatenee\Breadcrumb\Contracts\BreadcrumbDriverContract and add the following methods: getParentTags, getItemTags, getLastItemTags. Example:, (*11)

{content}';
    }

    public function getItemTags()
    {
        return '
  • {item}
  • '; } public function getLastItemTags() { return '
  • {item}
  • '; } } ?>

    The package will automatically use that information to generate your HTML., (*12)

    Running tests

    bash $ composer test, (*13)

    License

    This library is licensed under the MIT license. Please see LICENSE for more details., (*14)

    Changelog

    Please see CHANGELOG for more details., (*15)

    Contributing

    Please see CONTRIBUTING for more details., (*16)

    The Versions