Lots of changes
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
<?php // routes/breadcrumbs.php
|
||||
|
||||
// Note: Laravel will automatically resolve `Breadcrumbs::` without
|
||||
// this import. This is nice for IDE syntax and refactoring.
|
||||
use App\Models\Client;
|
||||
use App\Models\ClientCase;
|
||||
use Diglactic\Breadcrumbs\Breadcrumbs;
|
||||
|
||||
// This import is also not required, and you could replace `BreadcrumbTrail $trail`
|
||||
// with `$trail`. This is nice for IDE type checking and completion.
|
||||
use Diglactic\Breadcrumbs\Generator as BreadcrumbTrail;
|
||||
|
||||
// Dashboard
|
||||
Breadcrumbs::for('dashboard', function (BreadcrumbTrail $trail) {
|
||||
$trail->push('Dashboard', route('dashboard'));
|
||||
});
|
||||
|
||||
// Dashboard > Clients
|
||||
Breadcrumbs::for('client', function (BreadcrumbTrail $trail) {
|
||||
$trail->parent('dashboard');
|
||||
$trail->push('Clients', route('client'));
|
||||
});
|
||||
|
||||
// Dashboard > Clients > [Client]
|
||||
Breadcrumbs::for('client.show', function (BreadcrumbTrail $trail, Client $client) {
|
||||
$trail->parent('client');
|
||||
$trail->push($client->person->full_name, route('client.show', $client));
|
||||
});
|
||||
|
||||
// Dashboard > Cases
|
||||
|
||||
Breadcrumbs::for('clientCase', function (BreadcrumbTrail $trail) {
|
||||
$trail->parent('dashboard');
|
||||
$trail->push('Cases', route('clientCase'));
|
||||
});
|
||||
|
||||
// Dashboard > Cases > [Case]
|
||||
|
||||
Breadcrumbs::for('clientCase.show', function (BreadcrumbTrail $trail, ClientCase $clientCase) {
|
||||
$trail->parent('clientCase');
|
||||
$trail->push($clientCase->person->full_name, route('clientCase.show', $clientCase));
|
||||
});
|
||||
|
||||
// Dashboard > Settings
|
||||
Breadcrumbs::for('settings', function (BreadcrumbTrail $trail) {
|
||||
$trail->parent('dashboard');
|
||||
$trail->push('Settings', route('settings'));
|
||||
});
|
||||
Reference in New Issue
Block a user