27 lines
946 B
PHP
27 lines
946 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
use Diglactic\Breadcrumbs\Generator;
|
||
|
|
|
||
|
|
Breadcrumbs::for('home', function ( Generator $trail) {
|
||
|
|
$trail->push('Home', route('home'));
|
||
|
|
});
|
||
|
|
|
||
|
|
Breadcrumbs::for('entries.index', function ( Generator $trail) {
|
||
|
|
$trail->parent('home');
|
||
|
|
$trail->push('Database', route('entries.index'));
|
||
|
|
});
|
||
|
|
|
||
|
|
Breadcrumbs::for('entries.show', function ( Generator $trail, string $section, \App\Models\Entry $entry) {
|
||
|
|
$trail->parent('entries.index');
|
||
|
|
$trail->push($entry->title, route('entries.show', [ $section, $entry ] ) );
|
||
|
|
});
|
||
|
|
|
||
|
|
Breadcrumbs::for('submit.create', function ( Generator $trail, string $section ) {
|
||
|
|
$trail->parent('home');
|
||
|
|
$trail->push('Submit', route('submit.create', [ $section ] ) );
|
||
|
|
});
|
||
|
|
Breadcrumbs::for('submit.edit', function ( Generator $trail, string $section, \App\Models\Entry $entry ) {
|
||
|
|
$trail->parent('entries.show', $section, $entry);
|
||
|
|
$trail->push('Edit', route('submit.edit', [ $section, $entry ] ) );
|
||
|
|
});
|