PHP code example of mateusjatenee / laravel-breadcumb

1. Go to this page and download the library: Download mateusjatenee/laravel-breadcumb library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

mateusjatenee / laravel-breadcumb example snippets


Breadcrumb::generate('users.show')

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

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

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

Breadcumb::setDriver('driverName');



class BootstrapDriver extends BreadcrumbGenerator implements BreadcrumbDriverContract
{
    public function getParentTags()
    {
        return '<ol class="breadcrumb">{content}</ol>';
    }

    public function getItemTags()
    {
        return '<li><span>{item}</span></li>';
    }

    public function getLastItemTags()
    {
        return '<li class="active"><span>{item}</span></li>';
    }
}