1 | <?php
|
---|
2 |
|
---|
3 | use Illuminate\Support\Facades\Route;
|
---|
4 |
|
---|
5 | /*
|
---|
6 | |--------------------------------------------------------------------------
|
---|
7 | | Web Routes
|
---|
8 | |--------------------------------------------------------------------------
|
---|
9 | |
|
---|
10 | | Here is where you can register web routes for your application. These
|
---|
11 | | routes are loaded by the RouteServiceProvider within a group which
|
---|
12 | | contains the "web" middleware group. Now create something great!
|
---|
13 | |
|
---|
14 | */
|
---|
15 |
|
---|
16 | Route::get('/', function() {
|
---|
17 | return redirect()->route('dashboard.index');
|
---|
18 | });
|
---|
19 |
|
---|
20 | Route::get('/offline', function () {
|
---|
21 | return view('vendor/laravelpwa/offline');
|
---|
22 | });
|
---|
23 |
|
---|
24 | ////////////////////
|
---|
25 | // Auth Routes
|
---|
26 | ////////////////////
|
---|
27 | Route::group(['prefix' => 'auth'], function () {
|
---|
28 |
|
---|
29 | Route::get('/login', "Auth\LoginController@showLogin")->name("auth.loginShow");
|
---|
30 | Route::get('/verify-login/{id}/{token}', "Auth\VerifyLoginController@index")->middleware("CheckVerifyToken")->name("verify-login.index");
|
---|
31 | Route::post('/verify-login/{id}/{token}', "Auth\VerifyLoginController@verify")->name("verify-login");
|
---|
32 | Route::post('/login', "Auth\LoginController@login")->name("auth.login");
|
---|
33 | Route::post('/logout', "Auth\LoginController@logout")->name("auth.logout");
|
---|
34 |
|
---|
35 | Route::get('/forgot', "Auth\ForgotPasswordController@showForgotPassword")->name("auth.forgotShow");
|
---|
36 | Route::post('/forgot', "Auth\ForgotPasswordController@forgotPassword")->name("auth.forgot");
|
---|
37 |
|
---|
38 | Route::group(['middleware' => "createPassword"], function () {
|
---|
39 | Route::get('/create-password/{id}/{token}', "Auth\CreatePasswordController@showCreatePassword")->name("auth.create-password-show");
|
---|
40 | Route::post('/create-password/{id}/{token}', "Auth\CreatePasswordController@createPassword")->name("auth.create-password");
|
---|
41 | });
|
---|
42 |
|
---|
43 | });
|
---|
44 |
|
---|
45 | ////////////////////
|
---|
46 | // Dashboard Routes
|
---|
47 | ////////////////////
|
---|
48 | Route::group(['prefix' => 'dashboard', 'middleware' => ["auth", "checkIsActive"]], function () {
|
---|
49 |
|
---|
50 | Route::get("/", "Dashboard\IndexController@index")->name("dashboard.index");
|
---|
51 |
|
---|
52 | // Settings
|
---|
53 | Route::get("/settings", "Dashboard\SettingsController@settings")->name("dashboard.settings.index");
|
---|
54 | Route::patch("/settings/username", "Dashboard\SettingsController@updateUsername")->name("dashboard.settings.username");
|
---|
55 | Route::patch("/settings/password", "Dashboard\SettingsController@updatePassword")->name("dashboard.settings.password");
|
---|
56 | Route::patch("/settings/email", "Dashboard\SettingsController@updateEmail")->name("dashboard.settings.email");
|
---|
57 | Route::patch("/users/{id}/editUserData", "Dashboard\UsersController@editUserData")->name("dashboard.users.editUserData");
|
---|
58 |
|
---|
59 | //Settings File Validations
|
---|
60 | Route::group(['middleware' => 'permission:manage_file_types'], function () {
|
---|
61 | Route::patch("/settings/file-types", "Dashboard\SettingsController@fileTypes")->name("dashboard.settings.file-types");
|
---|
62 | });
|
---|
63 |
|
---|
64 | // Users view
|
---|
65 | Route::group(['middleware' => 'permission:view_all_users'], function () {
|
---|
66 | Route::get("/users", "Dashboard\UsersController@index")->name("dashboard.users.index");
|
---|
67 | });
|
---|
68 |
|
---|
69 | Route::group(['middleware' => 'permission:manage_all_users'], function () {
|
---|
70 | Route::get("/users/create", "Dashboard\UsersController@create")->name("dashboard.users.create");
|
---|
71 | Route::post("/users/store", "Dashboard\UsersController@store")->name("dashboard.users.store");
|
---|
72 | Route::get("/users/{id}/edit", "Dashboard\UsersController@editShow")->name("dashboard.users.editShow");
|
---|
73 | Route::patch("/users/{id}/edit", "Dashboard\UsersController@edit")->name("dashboard.users.edit");
|
---|
74 | Route::patch("/users/{id}/block", "Dashboard\UsersController@block")->name("dashboard.users.block");
|
---|
75 | Route::patch("/users/{id}/unblock", "Dashboard\UsersController@unblock")->name("dashboard.users.unblock");
|
---|
76 | Route::delete("/users/{id}/destroy", "Dashboard\UsersController@destroy")->name("dashboard.users.destroy");
|
---|
77 | });
|
---|
78 |
|
---|
79 | // Departments view
|
---|
80 | Route::group(['middleware' => 'permission:view_all_departments'], function () {
|
---|
81 | Route::get("/departments", "Dashboard\DepartmentsController@index")->name("dashboard.departments.index");
|
---|
82 | });
|
---|
83 |
|
---|
84 | // Departments manage
|
---|
85 | Route::group(['middleware' => 'permission:manage_all_departments'], function () {
|
---|
86 | Route::get("/departments/create", "Dashboard\DepartmentsController@create")->name("dashboard.departments.create");
|
---|
87 | Route::post("/departments/store", "Dashboard\DepartmentsController@store")->name("dashboard.departments.store");
|
---|
88 | Route::get("/departments/{id}/edit", "Dashboard\DepartmentsController@editShow")->name("dashboard.departments.editShow");
|
---|
89 | Route::patch("/departments/{id}/edit", "Dashboard\DepartmentsController@edit")->name("dashboard.departments.edit");
|
---|
90 | });
|
---|
91 |
|
---|
92 | // Folders view
|
---|
93 | Route::group(['middleware' => 'permission:view_all_folders'], function () {
|
---|
94 | Route::get("/folders", "Dashboard\FoldersController@index")->name("dashboard.folders.index");
|
---|
95 | Route::get('/folders/{id}/files', 'Dashboard\FoldersController@files')->name('dashboard.folders.files');
|
---|
96 | });
|
---|
97 |
|
---|
98 | // Folders manage
|
---|
99 | Route::group(['middleware' => 'permission:manage_all_folders'], function () {
|
---|
100 | Route::get("/folders/create", "Dashboard\FoldersController@create")->name("dashboard.folders.create");
|
---|
101 | Route::post("/folders/store", "Dashboard\FoldersController@store")->name("dashboard.folders.store");
|
---|
102 | Route::get("/folders/{id}/edit", "Dashboard\FoldersController@editShow")->name("dashboard.folders.editShow");
|
---|
103 | Route::post("/folders/{id}/upload", "Dashboard\FoldersController@uploadFiles")->name("dashboard.folders.uploadFiles");
|
---|
104 | });
|
---|
105 |
|
---|
106 | // Files view
|
---|
107 | Route::group(['middleware' => 'permission:view_all_files'], function () {
|
---|
108 | Route::get("files", "Dashboard\FilesController@index")->name("dashboard.files.index");
|
---|
109 | });
|
---|
110 |
|
---|
111 | //Files manage
|
---|
112 | Route::group(['middleware' => 'permission:manage_all_files'], function () {
|
---|
113 | Route::post("/files/store", "Dashboard\FilesController@store")->name("dashboard.files.store");
|
---|
114 | });
|
---|
115 |
|
---|
116 | //Export data
|
---|
117 | Route::group(['middleware' => 'permission:export_data'], function () {
|
---|
118 | Route::get('files/export', 'Dashboard\ExportExcelController@ExportFiles')->name("dashboard.files.export");
|
---|
119 | Route::get('folders/export', 'Dashboard\ExportExcelController@ExportFolders')->name("dashboard.folders.export");
|
---|
120 | Route::get('departments/export', 'Dashboard\ExportExcelController@ExportDepartments')->name("dashboard.departments.export");
|
---|
121 | Route::get('users/export', 'Dashboard\ExportExcelController@ExportUsers')->name("dashboard.users.export");
|
---|
122 | });
|
---|
123 |
|
---|
124 | //Download data
|
---|
125 | Route::group(['middleware' => 'permission:download_data'], function () {
|
---|
126 | Route::get('/departments/download-all', 'Dashboard\DepartmentsController@downloadAll')->name('dashboard.departments.downloadAll');
|
---|
127 | Route::get("files/{id}/download-file", "Dashboard\FilesController@downloadFile")->name("dashboard.files.downloadFile");
|
---|
128 | Route::get('/folders/{id}/download-folder', 'Dashboard\FoldersController@downloadFolder')->name('dashboard.folders.downloadFolder');
|
---|
129 | Route::get('/departments/{id}/download-department', 'Dashboard\DepartmentsController@downloadDepartment')->name('dashboard.departments.downloadDepartment');
|
---|
130 | });
|
---|
131 |
|
---|
132 | //Delete data
|
---|
133 | Route::group(['middleware' => 'permission:delete_data'], function() {
|
---|
134 | Route::delete("files/{id}/delete-file", "Dashboard\FilesController@deleteFile")->name("dashboard.files.deleteFile");
|
---|
135 | Route::delete("/folders/{id}/destroy", "Dashboard\FoldersController@destroy")->name("dashboard.folders.destroy");
|
---|
136 | Route::delete("/departments/{id}/destroy", "Dashboard\DepartmentsController@destroy")->name("dashboard.departments.destroy");
|
---|
137 | });
|
---|
138 | });
|
---|