104 lines
3.5 KiB
PHP
104 lines
3.5 KiB
PHP
<?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 App\Models\Segment;
|
|
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 > Notifications (Unread)
|
|
Breadcrumbs::for('notifications.unread', function (BreadcrumbTrail $trail): void {
|
|
$trail->parent('dashboard');
|
|
$trail->push('Obvestila', route('notifications.unread'));
|
|
});
|
|
|
|
Breadcrumbs::for('settings.contractConfigs.index', function (BreadcrumbTrail $trail): void {
|
|
$trail->parent('settings');
|
|
$trail->push('Contract Configs', route('settings.contractConfigs.index'));
|
|
});
|
|
|
|
// Dashboard
|
|
Breadcrumbs::for('dashboard', function (BreadcrumbTrail $trail) {
|
|
$trail->push('Nadzorna plošča', route('dashboard'));
|
|
});
|
|
|
|
// Dashboard > Clients
|
|
Breadcrumbs::for('client', function (BreadcrumbTrail $trail) {
|
|
$trail->parent('dashboard');
|
|
$trail->push('Naročniki', 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 > Clients > [Client] > Contracts
|
|
Breadcrumbs::for('client.contracts', function (BreadcrumbTrail $trail, Client $client) {
|
|
$trail->parent('client.show', $client);
|
|
$trail->push('Pogodbe', route('client.contracts', $client));
|
|
});
|
|
|
|
// Dashboard > Cases
|
|
|
|
Breadcrumbs::for('clientCase', function (BreadcrumbTrail $trail) {
|
|
$trail->parent('dashboard');
|
|
$trail->push('Primeri', 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('Nastavitve', route('settings'));
|
|
});
|
|
|
|
// Dashboard > Settings > Segments
|
|
Breadcrumbs::for('settings.segments', function (BreadcrumbTrail $trail) {
|
|
$trail->parent('settings');
|
|
$trail->push('Segmenti', route('settings.segments'));
|
|
});
|
|
|
|
// Dashboard > Settings > Workflow
|
|
Breadcrumbs::for('settings.workflow', function (BreadcrumbTrail $trail) {
|
|
$trail->parent('settings');
|
|
$trail->push('Potek dela', route('settings.workflow'));
|
|
});
|
|
|
|
// Dashboard > Settings > Field Job
|
|
Breadcrumbs::for('settings.fieldjob.index', function (BreadcrumbTrail $trail) {
|
|
$trail->parent('settings');
|
|
$trail->push('Terensko delo', route('settings.fieldjob.index'));
|
|
});
|
|
|
|
// Dashboard > Settings > Payments
|
|
Breadcrumbs::for('settings.payment.edit', function (BreadcrumbTrail $trail) {
|
|
$trail->parent('settings');
|
|
$trail->push('Plačila', route('settings.payment.edit'));
|
|
});
|
|
|
|
// Dashboard > Segments
|
|
Breadcrumbs::for('segments.index', function (BreadcrumbTrail $trail) {
|
|
$trail->parent('dashboard');
|
|
$trail->push('Segmenti', route('segments.index'));
|
|
});
|
|
|
|
// Dashboard > Segments > [Segment]
|
|
Breadcrumbs::for('segments.show', function (BreadcrumbTrail $trail, Segment $segment) {
|
|
$trail->parent('segments.index');
|
|
$trail->push($segment->name, route('segments.show', $segment));
|
|
});
|