1. Go to this page and download the library: Download tabuna/breadcrumbs 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/ */
tabuna / breadcrumbs example snippets
$ composer
use Tabuna\Breadcrumbs\Trail;
// Home
Route::get('/', fn () => view('home'))
->name('home')
->breadcrumbs(fn (Trail $trail) =>
$trail->push('Home', route('home'))
);
// Home > About
Route::get('/about', fn () => view('home'))
->name('about')
->breadcrumbs(fn (Trail $trail) =>
$trail->parent('home')->push('About', route('about'))
);
Route::get('/category/{category}', function (Category $category){
//In this example, the category object is your Eloquent model.
//code...
})
->name('category')
->breadcrumbs(fn (Trail $trail, Category $category) =>
$trail->push($category->title, route('category', $category->id))
);
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
class BreadcrumbsServiceProvider extends ServiceProvider
{
/**
* Bootstrap the application events.
*
* @return void
*/
public function boot()
{