/ routes / web.php
web.php
  1  <?php
  2  
  3  use App\Http\Controllers\Auth\LogoutController;
  4  use App\Http\Controllers\FileController;
  5  use App\Http\Livewire\Auth\Login;
  6  use App\Http\Livewire\App\Settings as Settings;
  7  use App\Http\Livewire\Documents\Document\Index as DocumentIndex;
  8  use App\Http\Livewire\Documents\OutPuts\Index as OutPutIndex;
  9  
 10  use App\Http\Livewire\Dossiers\Dossier\Index as DossierIndex;
 11  use App\Http\Livewire\Dossiers\Dossier\View as DossierView;
 12  
 13  use App\Http\Livewire\InboxFiles\Index as InboxFileIndex;
 14  use App\Http\Livewire\InboxFiles\View as InboxFileView;
 15  use App\Http\Livewire\InboxFiles\Validation\Index as InboxFileValidationIndex;
 16  
 17  use App\Http\Livewire\Entities\Index as EntityIndex;
 18  
 19  // Entities
 20  use App\Http\Livewire\Entities\View as EntityView;
 21  use App\Http\Livewire\Jsons\Validation\View;
 22  use App\Http\Livewire\Norms\Group\Index as NormGroupIndex;
 23  
 24  // Users
 25  use App\Http\Livewire\Norms\Group\View as NormGroupView;
 26  use App\Http\Livewire\Norms\Norm\View as NormView;
 27  
 28  // TOES
 29  use App\Http\Livewire\Tasks\Task\Index as TaskIndex;
 30  use App\Http\Livewire\Tasks\Task\View as TaskView;
 31  use App\Http\Livewire\TOES\Category\Index as TOECategoryIndex;
 32  
 33  // Certified products
 34  use App\Http\Livewire\CertifiedProducts\Index as CertifiedProductIndex;
 35  use App\Http\Livewire\CertifiedProducts\View as CertifiedProductView;
 36  
 37  
 38  // Taxonomies
 39  use App\Http\Livewire\TOES\TOE\Index as TOEIndex;
 40  use App\Http\Livewire\TOES\TOE\View as TOEView;
 41  use App\Http\Livewire\Users\Index as UserIndex;
 42  
 43  // Tasks
 44  use App\Http\Livewire\Users\View as UserView;
 45  use Illuminate\Support\Facades\Route;
 46  
 47  // Audits
 48  use App\Http\Livewire\Audits\Index as AuditsIndex;
 49  use App\Http\Livewire\Auth\TwoFactorChallenge;
 50  use App\Http\Livewire\Documents\Document\Folders;
 51  //Meet
 52  use App\Http\Livewire\Dossiers\Dossier\Meet\View as MeetView;
 53  
 54  use App\Http\Livewire\Notifications\Index as NotificationsIndex;
 55  
 56  //Templates
 57  use App\Http\Livewire\Dossiers\DossierTemplates\Index as DossierTemplateIndex;
 58  use App\Http\Livewire\Reviews\Index as ReviewIndex;
 59  
 60  // Role
 61  use App\Http\Livewire\RolesAndPermissions\Role\Index as RoleIndex;
 62  use App\Http\Livewire\RolesAndPermissions\Role\Show as RoleShow;
 63  
 64  //Permission
 65  use App\Http\Livewire\RolesAndPermissions\Permission\Index as PermissionIndex;
 66  
 67  //Evidences
 68  use App\Http\Livewire\Evidences\Index as EvidenceIndex;
 69  use App\Http\Livewire\Evidences\View as EvidenceView;
 70  
 71  
 72  use App\Http\Livewire\VulnerabilityMail\Index as VulnerabilityMailIndex;
 73  
 74  //Jsons
 75  
 76  use App\Http\Livewire\Jsons\Index as JsonIndex;
 77  use App\Http\Livewire\Jsons\View as JsonView;
 78  use App\Http\Livewire\Jsons\View as JsonDraftView;
 79  
 80  //Resolutions
 81  
 82  use App\Http\Livewire\Resolutions\GlobalIndex as ResolutionIndex;
 83  
 84  //Non Conformity
 85  use App\Http\Livewire\NonConformity\Index as NonConformityIndex;
 86  use App\Http\Livewire\NonConformity\View as NonConformityView;
 87  
 88  //Protection Profiles
 89  use App\Http\Livewire\ProtectionProfile\Index as ProtectionProfileIndex;
 90  
 91  //EML
 92  use App\Http\Livewire\Eml\Index as EmlIndex;
 93  
 94  
 95  /*
 96  |--------------------------------------------------------------------------
 97  | Web Routes
 98  |--------------------------------------------------------------------------
 99  |
100  | Here is where you can register web routes for your application. These
101  | routes are loaded by the RouteServiceProvider within a group which
102  | contains the "web" middleware group. Now create something great!
103  |
104  */
105  
106  Route::middleware('signed')->group(function () {
107      Route::get('document/{document}', [\App\Http\Controllers\DocumentController::class, 'show'])->name('documents.show');
108      Route::get('certificate/{xml}', [\App\Http\Controllers\DocumentController::class, 'showXML'])->name('documents.showXML');
109  });
110  
111  
112  Route::middleware('guest')->group(function () {
113      Route::get('/', Login::class)->name('login');
114      Route::get('two-factor-challenge/{user}', TwoFactorChallenge::class)->name('auth.two-factor-challenge');
115      Route::get('login', function () {
116          return redirect('/');
117      });
118  });
119  
120  Route::middleware(['auth'])->group(function () {
121      /** Documents */
122      Route::get('/documents', DocumentIndex::class)->name('documents.index');
123      Route::get('/documents/folders', Folders::class)->name('documents.folders');
124      Route::get('/documents/pending', \App\Http\Livewire\Documents\Pending\Index::class)->name('documents.pending');
125      Route::get('/documents/templates', \App\Http\Livewire\Documents\Templates\Index::class)->name('documents.templates.index');
126      Route::get('/documents/templates/tokens', \App\Http\Livewire\Documents\Templates\Tokens\Index::class)->name('documents.templates.tokens.index');
127      Route::get('/documents/{document}', \App\Http\Livewire\Documents\Version\Index::class)->name('document.versions.index');
128      Route::get('/documents/{document}/out-puts', OutPutIndex::class)->name('document.out-puts.index');
129  
130  
131      /** Dossiers */
132      Route::get('/dossiers', DossierIndex::class)->name('dossiers.dossier.index');
133      Route::get('/dossiers/dossier/{dossier}', DossierView::class)->name('dossiers.dossier.view');
134      Route::get('/dossiers/create', \App\Http\Livewire\Dossiers\Dossier\Create\Manual
135      ::class)->name('dossiers.dossier.create');
136  
137      /**Meets */
138      Route::get('/meets/meet/{meet}', MeetView::class)->name('dossiers.dossier.meet.view');
139  
140      /** Entities */
141      Route::get('/entities', EntityIndex::class)->name('entities.index');
142      Route::get('/entities/{entity}', EntityView::class)->name('entities.view');
143  
144      Route::get('/inbox-files', InboxFileIndex::class)->name('validations.inbox-files.index');
145      Route::get('/inbox-files/{inboxFile}', InboxFileView::class)->name('validations.inbox-files.view');
146  //    Route::get('/inbox-files/{inboxFile}/validations', InboxFileValidationIndex::class)->name('validations.inbox-files.validations.index');
147  
148      /** Non-conformity */
149      Route::get('/non-conformities/{nonConformity}', NonConformityView::class)->name('non-conformities.view');
150      Route::get('/non-conformities', NonConformityIndex::class)->name('non-conformities.index');
151  
152      /** Users */
153      Route::get('/users', UserIndex::class)->name('users.index');
154      Route::get('/users/{user}', UserView::class)->name('users.view');
155  
156      /** Toes */
157      Route::get('/toes', TOEIndex::class)->name('toes.index');
158  //    Deprecated
159  //    Route::get('/toes/categories', TOECategoryIndex::class)->name('toes.categories.index');
160      Route::get('/toes/toe/{toe}', TOEView::class)->name('toes.toe.view');
161  
162      /** Certified products */
163      Route::get('/certified-products', CertifiedProductIndex::class)->name('certified-products.index');
164  //    Route::get('/certified-products/{certifiedProductId}', CertifiedProductView::class)->name('certified-products.view');
165  
166      /** Tasks*/
167      Route::get('/tasks', TaskIndex::class)->name('tasks.task.index');
168      Route::get('/tasks/{task}', TaskView::class)->name('tasks.task.view');
169  
170      /** Norms */
171      Route::get('/norms/groups', NormGroupIndex::class)->name('norms.groups.index');
172      Route::get('/norms/group/{normGroup}', NormGroupView::class)->name('norms.group.view');
173      Route::get('/norms/norm/{norm}', NormView::class)->name('norms.norm.view');
174  
175      /** Templates*/
176      Route::get('/dossier-templates', DossierTemplateIndex::class)->name('dossiers.dossier-templates.index');
177  
178      /** Notifications */
179      Route::get('/notifications', NotificationsIndex::class)->name('notifications.index');
180  
181      /* App */
182      Route::get('/settings', Settings::class)->name('app.settings');
183  
184      /* Audits */
185      Route::get('/audits', AuditsIndex::class)->name('audits.index');
186  
187      Route::post('logout', LogoutController::class)
188          ->name('logout');
189  
190      /** Roles */
191  //    Route::get('/roles', RoleIndex::class)->name('roles.index');
192  //    Route::get('/role/{roleId}', RoleShow::class)->name('role.show');
193  
194      /** Permissions */
195  //    Route::get('/permissions', PermissionIndex::class)->name('permissions.index');
196  
197      /** Evidences */ //TODO: recover from local
198      //Route::get('/evidences', EvidenceIndex::class)->name('evidences.index');
199      //Route::get('/evidences/{evidence}', EvidenceView::class)->name('evidences.view');
200  
201  
202      /** Vulnerability mails */
203  //    Route::get('/vulnerability-mail', VulnerabilityMailIndex::class)->name('vulnerability-mail.index');
204  
205      /**Jsons */
206  //    Route::get('/jsons', JsonIndex::class)->name('jsons.index');
207  //    Route::get('/jsons/{id}', JsonView::class)->name('jsons.view');
208  //    Route::get('/jsons/json-draft/{id}', JsonDraftView::class)->name('jsons.draft-view');
209  //    Route::get('/jsons/json-draft/{jsonDraft}/validate', View::class)->name('validations.jsons.view');
210  
211      /**Resolutions */
212      Route::get('/resolutions', ResolutionIndex::class)->name('resolutions.index');
213  
214      /**Protection Profiles */
215      Route::get('/protection-profiles', ProtectionProfileIndex::class)->name('protection-profiles.index');
216  
217      /** Big file downloads */
218      Route::get('/download/{path}', [FileController::class, 'download'])
219          ->where('path', '.*')
220          ->name('file.download');
221  
222      /**EML */
223      Route::get('/emls', EmlIndex::class)->name('emls.index');
224  });