1 | <?php
|
---|
2 |
|
---|
3 | use App\Http\Controllers\CrimeCaseController;
|
---|
4 | use App\Http\Controllers\OfficerController;
|
---|
5 | use App\Http\Controllers\PeopleController;
|
---|
6 | use App\Http\Controllers\SessionsController;
|
---|
7 | use Illuminate\Support\Facades\Route;
|
---|
8 | use 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
|
---|
22 | Route::get('/login', function () {
|
---|
23 | return view('login');
|
---|
24 |
|
---|
25 | });
|
---|
26 | Route::post('/login', [SessionsController::class, 'store']);
|
---|
27 |
|
---|
28 | Route::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
|
---|
34 | Route::get('register-statement', [CrimeCaseController::class, 'register_statement'])->middleware('policeman');
|
---|
35 | Route::post('register-statement', [CrimeCaseController::class, 'register_statement_post'])->middleware('policeman');
|
---|
36 |
|
---|
37 | // OFFICER
|
---|
38 | Route::get('register-policeman', [OfficerController::class, 'register'])->middleware('officer');
|
---|
39 | Route::post('register-policeman', [OfficerController::class, 'register_post'])->middleware('officer');
|
---|
40 |
|
---|
41 | // BOTH
|
---|
42 | Route::get('/', function () {
|
---|
43 | return view('welcome');
|
---|
44 | })->middleware('both');
|
---|
45 | Route::get('logout', [SessionsController::class, 'logout']);
|
---|
46 |
|
---|
47 | Route::get('employees', [OfficerController::class, 'employees'])->middleware('both');
|
---|
48 | Route::get('/employees/{id}', [OfficerController::class, 'show'])->middleware('both');
|
---|
49 |
|
---|
50 | Route::get('filter', [PeopleController::class, 'filter'])->middleware('both');
|
---|
51 | Route::post('filter', [PeopleController::class, 'filter_post'])->middleware('both');
|
---|
52 |
|
---|
53 | Route::get('cases', [CrimeCaseController::class, 'cases'])->middleware('both');
|
---|
54 | Route::get('case/{wildcard}', [CrimeCaseController::class, 'case'])->middleware('both');
|
---|
55 | Route::get('finished_cases', [CrimeCaseController::class, 'finished_cases'])->middleware('both');
|
---|
56 |
|
---|
57 | Route::post('/get-person', [PeopleController::class, 'getPerson'])->middleware('both');
|
---|