[c454c0f] | 1 | <?php
|
---|
| 2 |
|
---|
[75151c6] | 3 | use App\Http\Controllers\CrimeCaseController;
|
---|
| 4 | use App\Http\Controllers\OfficerController;
|
---|
| 5 | use App\Http\Controllers\PeopleController;
|
---|
| 6 | use App\Http\Controllers\SessionsController;
|
---|
[c454c0f] | 7 | use Illuminate\Support\Facades\Route;
|
---|
[d9c4096] | 8 | use Illuminate\Support\Facades\Session;
|
---|
[c454c0f] | 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 |
|
---|
[5372778] | 21 | // UNAUTHORIZED
|
---|
[c454c0f] | 22 | Route::get('/login', function () {
|
---|
| 23 | return view('login');
|
---|
[cf84baa] | 24 |
|
---|
[c454c0f] | 25 | });
|
---|
[cf84baa] | 26 | Route::post('/login', [SessionsController::class, 'store']);
|
---|
| 27 |
|
---|
[5372778] | 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'
|
---|
[cf84baa] | 31 |
|
---|
[5372778] | 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');
|
---|
[249bf91] | 36 |
|
---|
[5372778] | 37 | // OFFICER
|
---|
| 38 | Route::get('register-policeman', [OfficerController::class, 'register'])->middleware('officer');
|
---|
| 39 | Route::post('register-policeman', [OfficerController::class, 'register_post'])->middleware('officer');
|
---|
[cf84baa] | 40 |
|
---|
[5372778] | 41 | // BOTH
|
---|
| 42 | Route::get('/', function () {
|
---|
| 43 | return view('welcome');
|
---|
| 44 | })->middleware('both');
|
---|
| 45 | Route::get('logout', [SessionsController::class, 'logout']);
|
---|
[6b10b67] | 46 |
|
---|
[5372778] | 47 | Route::get('employees', [OfficerController::class, 'employees'])->middleware('both');
|
---|
| 48 | Route::get('/employees/{id}', [OfficerController::class, 'show'])->middleware('both');
|
---|
[768f473] | 49 |
|
---|
[5372778] | 50 | Route::get('filter', [PeopleController::class, 'filter'])->middleware('both');
|
---|
| 51 | Route::post('filter', [PeopleController::class, 'filter_post'])->middleware('both');
|
---|
[768f473] | 52 |
|
---|
[5372778] | 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');
|
---|
[768f473] | 56 |
|
---|
[5372778] | 57 | Route::post('/get-person', [PeopleController::class, 'getPerson'])->middleware('both');
|
---|