Changeset 5372778
- Timestamp:
- 08/26/24 14:20:34 (3 months ago)
- Branches:
- main
- Children:
- 3c89e27
- Parents:
- 8a258ab
- Files:
-
- 4 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
app/Http/Controllers/SessionsController.php
r8a258ab r5372778 54 54 if ($this->verifyPassword($password, $value, $value2)) { 55 55 // Authentication passed 56 Session::put('auth', true); 56 57 Session::put('badge_no', $badge_no); 57 58 Session::put('is_policeman', $policeman); -
app/Http/Kernel.php
r8a258ab r5372778 22 22 \App\Http\Middleware\TrimStrings::class, 23 23 \Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class, 24 ]; 25 protected $routeMiddleware = [ 26 // other middleware 27 'policeman' => \App\Http\Middleware\CheckPoliceman::class, 28 'officer' => \App\Http\Middleware\CheckOfficer::class, 29 'both' => \App\Http\Middleware\CheckBoth::class, 24 30 ]; 25 31 -
routes/web.php
r8a258ab r5372778 19 19 */ 20 20 21 Route::get('/', function () { 22 return view('welcome'); 23 }); 21 // UNAUTHORIZED 24 22 Route::get('/login', function () { 25 23 return view('login'); 26 24 27 25 }); 28 29 26 Route::post('/login', [SessionsController::class, 'store']); 30 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 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'); 32 45 Route::get('logout', [SessionsController::class, 'logout']); 33 46 47 Route::get('employees', [OfficerController::class, 'employees'])->middleware('both'); 48 Route::get('/employees/{id}', [OfficerController::class, 'show'])->middleware('both'); 34 49 50 Route::get('filter', [PeopleController::class, 'filter'])->middleware('both'); 51 Route::post('filter', [PeopleController::class, 'filter_post'])->middleware('both'); 35 52 36 Route::get('employees', [OfficerController::class, 'employees'])->middleware('guest'); 37 Route::get('/employees/{id}', [OfficerController::class, 'show']); 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'); 38 56 39 Route::get('filter', [PeopleController::class, 'filter'])->middleware('guest'); 40 Route::post('filter', [PeopleController::class, 'filter_post'])->middleware('guest'); 41 42 Route::get('cases', [CrimeCaseController::class, 'cases'])->middleware('guest'); 43 44 Route::get('case/{wildcard}', [CrimeCaseController::class, 'case'])->name('case')->middleware('guest'); 45 46 Route::get('finished_cases', [CrimeCaseController::class, 'finished_cases'])->middleware('guest'); 47 48 49 Route::get('register-policeman', [OfficerController::class, 'register'])->middleware('guest'); 50 Route::post('register-policeman', [OfficerController::class, 'register_post'])->middleware('guest'); 51 52 Route::get('register-statement', [CrimeCaseController::class, 'register_statement'])->middleware('guest'); 53 Route::post('register-statement', [CrimeCaseController::class, 'register_statement_post'])->middleware('guest'); 54 55 56 57 Route::post('/get-person', [PeopleController::class, 'getPerson']); 57 Route::post('/get-person', [PeopleController::class, 'getPerson'])->middleware('both');
Note:
See TracChangeset
for help on using the changeset viewer.