PHP code example of shibuyakosuke / laravel-crud-breadcrumbs
1. Go to this page and download the library: Download shibuyakosuke/laravel-crud-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/ */
shibuyakosuke / laravel-crud-breadcrumbs example snippets
use App\Models\User;
Breadcrumbs::for('home', function ($trail) {
$trail->add('Home', route('home'));
});
Breadcrumbs::for('users.index', function ($trail) {
$trail->parent('home');
$trail->add('Users', route('users.index'));
});
Breadcrumbs::for('users.show', function ($trail, User $user) {
$trail->parent('users.index');
$trail->add($user->name, route('users.show', $user));
});
Breadcrumbs::for('users.edit', function ($trail, User $user) {
$trail->parent('users.show', $user);
$trail->add('Edit', route('users.edit', $user));
});
php artisan vendor:publish --tag=breadcrumbs