Initial commit
This commit is contained in:
26
routes/breadcrumbs.php
Normal file
26
routes/breadcrumbs.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?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 ] ) );
|
||||
});
|
||||
Reference in New Issue
Block a user