source: routes/web.php@ 5372778

main
Last change on this file since 5372778 was 5372778, checked in by bube-ristovska <ristovska725@…>, 3 months ago

Middleware for permissions based on officer, policeman or both

  • Property mode set to 100644
File size: 2.2 KB
Line 
1<?php
2
3use App\Http\Controllers\CrimeCaseController;
4use App\Http\Controllers\OfficerController;
5use App\Http\Controllers\PeopleController;
6use App\Http\Controllers\SessionsController;
7use Illuminate\Support\Facades\Route;
8use Illuminate\Support\Facades\Session;
9
10/*
11|--------------------------------------------------------------------------
12| Web Routes
13|--------------------------------------------------------------------------
14|
15| Here is where you can register web routes for your application. These
16| routes are loaded by the RouteServiceProvider and all of them will
17| be assigned to the "web" middleware group. Make something great!
18|
19*/
20
21// UNAUTHORIZED
22Route::get('/login', function () {
23 return view('login');
24
25});
26Route::post('/login', [SessionsController::class, 'store']);
27
28Route::get('/unauth', function () {
29 return view('unauth'); // Make sure there is a view file named `unauth.blade.php`
30})->name('unauth'); // Name the route 'unauth'
31
32// AUTHORIZED
33// POLICEMAN
34Route::get('register-statement', [CrimeCaseController::class, 'register_statement'])->middleware('policeman');
35Route::post('register-statement', [CrimeCaseController::class, 'register_statement_post'])->middleware('policeman');
36
37// OFFICER
38Route::get('register-policeman', [OfficerController::class, 'register'])->middleware('officer');
39Route::post('register-policeman', [OfficerController::class, 'register_post'])->middleware('officer');
40
41// BOTH
42Route::get('/', function () {
43 return view('welcome');
44})->middleware('both');
45Route::get('logout', [SessionsController::class, 'logout']);
46
47Route::get('employees', [OfficerController::class, 'employees'])->middleware('both');
48Route::get('/employees/{id}', [OfficerController::class, 'show'])->middleware('both');
49
50Route::get('filter', [PeopleController::class, 'filter'])->middleware('both');
51Route::post('filter', [PeopleController::class, 'filter_post'])->middleware('both');
52
53Route::get('cases', [CrimeCaseController::class, 'cases'])->middleware('both');
54Route::get('case/{wildcard}', [CrimeCaseController::class, 'case'])->middleware('both');
55Route::get('finished_cases', [CrimeCaseController::class, 'finished_cases'])->middleware('both');
56
57Route::post('/get-person', [PeopleController::class, 'getPerson'])->middleware('both');
Note: See TracBrowser for help on using the repository browser.