This repository was archived by the owner on Nov 25, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathweb.php
99 lines (82 loc) · 4.58 KB
/
web.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
<?php
use App\Http\Livewire\Dashboard\Receptionist\Reservation\Proof as ReservationProof;
use App\Http\Livewire\Dashboard\User\Reservation\Proof;
use Illuminate\Support\Facades\Route;
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/
Route::namespace('App\Http\Livewire')->group(function () {
//? Routes that can be accessed only when logging in
Route::middleware(['verified'])->group(function () {
//? Route for dashboard page
Route::prefix('/dashboard')->namespace('Dashboard')->name('dashboard.')->group(function () {
//? Route for admin dashboard page
Route::prefix('/admin')->namespace('Admin')->middleware('role:admin')->name('admin.')->group(function () {
//? Displays data statistics and to set up page about
Route::get('/', Index::class)->name('index');
//? To set gallery section
Route::get('/galeries', Galery\Index::class)->name('galeries');
//? To manage hotel facility data
Route::prefix('/facilities')->namespace('Facility')->name('facilities.')->group(function () {
Route::get('/', Index::class)->name('index');
Route::get('/create', Create::class)->name('create');
Route::get('/{facility:code}/edit', Edit::class)->name('edit');
});
//? To manage hotel room data
Route::prefix('/rooms')->namespace('Room')->name('rooms.')->group(function () {
Route::get('/', Index::class)->name('index');
Route::get('/create', Create::class)->name('create');
Route::get('/{room:code}/edit', Edit::class)->name('edit');
});
//? To manage user data
Route::prefix('/users')->namespace('User')->name('users.')->group(function () {
Route::get('/', Index::class)->name('index');
});
});
//? Route for user dashboard page
Route::prefix('/user')->namespace('User')->middleware('role:user')->name('user.')->group(function () {
//? Displays data statistics
Route::get('/', Index::class)->name('index');
Route::prefix('/reservation')->namespace('Reservation')->name('reservations.')->group(function () {
Route::get('/', Index::class)->name('index');
Route::get('/proof/{reservation:code}', [Proof::class, 'render'])->name('proof');
});
Route::prefix('/reviews')->namespace('Review')->name('reviews.')->group(function () {
Route::namespace('Room')->group(function () {
Route::get('/rooms', Index::class)->name('rooms.index');
});
Route::namespace('Facility')->group(function () {
Route::get('/facilities', Index::class)->name('facilities.index');
});
});
});
//? Route for receptionist dashboard page
Route::prefix('/receptionist')->namespace('Receptionist')->middleware('role:receptionist')->name('receptionist.')->group(function () {
//? Displays data statistics
Route::get('/', Index::class)->name('index');
Route::prefix('/reservation')->namespace('Reservation')->name('reservations.')->group(function () {
Route::get('/', Index::class)->name('index');
Route::get('/proof/{reservation:code}', [ReservationProof::class, 'render'])->name('proof');
});
});
});
});
//? Routes that can be accessed by logging in or without logging in
Route::get('/', Index::class)->name('index');
Route::get('/about', About::class)->name('about');
Route::prefix('/facilities')->namespace('Facility')->name('facilities.')->group(function () {
Route::get('/{facility:code}', Index::class)->name('index');
});
Route::prefix('/rooms')->namespace('Room')->name('rooms.')->group(function () {
Route::get('/', Index::class)->name('index');
Route::get('/{room:code}', Show::class)->name('show');
});
});
require __DIR__ . '/auth.php';