-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbreadcrumbs.php
101 lines (85 loc) · 3.9 KB
/
breadcrumbs.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
<?php
use App\Models\Booking;
use App\Models\Education;
use App\Models\Eductaion;
use App\Models\Experience;
use App\Models\HomePage;
use App\Models\PersonalInformation;
use App\Models\Service;
use App\Models\Skill;
use App\Models\Testimonial;
use App\Models\Project;
use App\Models\Property;
use App\Models\User;
use Diglactic\Breadcrumbs\Breadcrumbs;
use Diglactic\Breadcrumbs\Generator as BreadcrumbTrail;
use Spatie\Permission\Models\Role;
// Home
Breadcrumbs::for('home', function (BreadcrumbTrail $trail) {
$trail->push('Home', route('dashboard'));
});
// Home > Dashboard
Breadcrumbs::for('dashboard', function (BreadcrumbTrail $trail) {
$trail->parent('home');
$trail->push('Dashboard', route('dashboard'));
});
// Home > Dashboard > User Management
Breadcrumbs::for('user-management.index', function (BreadcrumbTrail $trail) {
$trail->parent('dashboard');
$trail->push('User Management', route('user-management.users.index'));
});
// Home > Dashboard > User Management > Users
Breadcrumbs::for('user-management.users.index', function (BreadcrumbTrail $trail) {
$trail->parent('user-management.index');
$trail->push('Users', route('user-management.users.index'));
});
// Home > Dashboard > User Management > Users > [User]
Breadcrumbs::for('user-management.users.show', function (BreadcrumbTrail $trail, User $user) {
$trail->parent('user-management.users.index');
$trail->push(ucwords($user->name), route('user-management.users.show', $user));
});
// Home > Dashboard > User Management > Roles
Breadcrumbs::for('user-management.roles.index', function (BreadcrumbTrail $trail) {
$trail->parent('user-management.index');
$trail->push('Roles', route('user-management.roles.index'));
});
// Home > Dashboard > User Management > Roles > [Role]
Breadcrumbs::for('user-management.roles.show', function (BreadcrumbTrail $trail, Role $role) {
$trail->parent('user-management.roles.index');
$trail->push(ucwords($role->name), route('user-management.roles.show', $role));
});
// Home > Dashboard > User Management > Permission
Breadcrumbs::for('user-management.permissions.index', function (BreadcrumbTrail $trail) {
$trail->parent('user-management.index');
$trail->push('Permissions', route('user-management.permissions.index'));
});
// Home > Dashboard > Property Management
Breadcrumbs::for('property-management.index', function (BreadcrumbTrail $trail) {
$trail->parent('dashboard');
$trail->push('Property Management', route('property-management.properties.index'));
});
// Home > Dashboard > Property Management > Properties
Breadcrumbs::for('property-management.properties.index', function (BreadcrumbTrail $trail) {
$trail->parent('dashboard');
$trail->push('Properties', route('property-management.properties.index'));
});
// Home > Dashboard > Property Management > Properties > [Property]
Breadcrumbs::for('property-management.properties.show', function (BreadcrumbTrail $trail, Property $property) {
$trail->parent('property-management.properties.index');
$trail->push(ucwords($property->name), route('property-management.properties.show', $property));
});
// Home > Dashboard > Booking Management
Breadcrumbs::for('booking-management.index', function (BreadcrumbTrail $trail) {
$trail->parent('dashboard');
$trail->push('Booking Management', route('booking-management.bookings.index'));
});
// Home > Dashboard > Booking Management > Properties
Breadcrumbs::for('booking-management.bookings.index', function (BreadcrumbTrail $trail) {
$trail->parent('dashboard');
$trail->push('Properties', route('booking-management.bookings.index'));
});
// Home > Dashboard > Booking Management > Properties > [Booking]
Breadcrumbs::for('booking-management.bookings.show', function (BreadcrumbTrail $trail, Booking $booking) {
$trail->parent('booking-management.bookings.index');
$trail->push(ucwords($booking->name), route('booking-management.bookings.show', $booking));
});