rbrecruiter/routes/web.php

280 lines
9.9 KiB
PHP
Raw Normal View History

2020-04-26 04:09:32 +00:00
<?php
2020-10-08 22:47:23 +00:00
use App\Http\Controllers\ApplicationController;
use App\Http\Controllers\AppointmentController;
use App\Http\Controllers\Auth\TwofaController;
use App\Http\Controllers\BanController;
use App\Http\Controllers\CommentController;
use App\Http\Controllers\ContactController;
use App\Http\Controllers\DashboardController;
use App\Http\Controllers\DevToolsController;
use App\Http\Controllers\FormController;
use App\Http\Controllers\HomeController;
use App\Http\Controllers\ProfileController;
use App\Http\Controllers\TeamController;
use App\Http\Controllers\UserController;
use App\Http\Controllers\VacancyController;
use App\Http\Controllers\VoteController;
2020-04-26 04:09:32 +00:00
use Illuminate\Support\Facades\Route;
2020-10-08 22:47:23 +00:00
use Mcamara\LaravelLocalization\Facades\LaravelLocalization;
2020-04-26 04:09:32 +00:00
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/
2020-09-02 17:39:45 +00:00
Route::group(['prefix' => LaravelLocalization::setLocale(), 'middleware' => [ 'localeSessionRedirect', 'localizationRedirect', 'localeViewPath' ]], function (){
Route::group(['prefix' => 'auth', 'middleware' => ['usernameUUID']], function (){
2020-09-03 19:06:29 +00:00
Auth::routes(['verify' => true]);
2020-07-17 21:44:10 +00:00
2020-10-08 22:47:23 +00:00
Route::post('/twofa/authenticate', [TwofaController::class, 'verify2FA'])
->name('verify2FA');
});
2020-10-08 22:47:23 +00:00
Route::get('/', [HomeController::class, 'index'])
->middleware('eligibility');
2020-10-08 22:47:23 +00:00
Route::post('/form/contact', [ContactController::class, 'create'])
->name('sendSubmission');
2020-10-08 22:47:23 +00:00
Route::get('/accounts/danger-zone/{ID}/{action}/{token}', [UserController::class, 'processDeleteConfirmation'])
->name('processDeleteConfirmation');
2020-09-03 19:06:29 +00:00
Route::group(['middleware' => ['auth', 'forcelogout', '2fa', 'verified']], function(){
2020-05-02 05:54:14 +00:00
2020-10-08 22:47:23 +00:00
Route::get('/dashboard', [DashboardController::class, 'index'])
->name('dashboard')
->middleware('eligibility');
2020-10-08 22:47:23 +00:00
Route::get('users/directory', [ProfileController::class, 'index'])
->name('directory');
2020-10-03 20:36:35 +00:00
2020-10-08 22:47:23 +00:00
Route::post('teams/{team}/invites/send', [TeamController::class, 'invite'])
->name('sendInvite');
2020-10-08 22:47:23 +00:00
Route::get('teams/{team}/switch', [TeamController::class, 'switchTeam'])
->name('switchTeam');
2020-10-03 20:36:35 +00:00
2020-10-08 22:47:23 +00:00
Route::get('teams/invites/{action}/{token}', [TeamController::class, 'processInviteAction'])
2020-10-03 20:36:35 +00:00
->name('processInvite');
2020-10-08 22:47:23 +00:00
// WARNING: This is a resource, might not work under laravel 8.
Route::resource('teams', TeamController::class);
2020-10-03 20:36:35 +00:00
Route::group(['prefix' => '/applications'], function (){
2020-10-08 22:47:23 +00:00
Route::get('/my-applications', [ApplicationController::class, 'showUserApps'])
->name('showUserApps')
->middleware('eligibility');
2020-10-08 22:47:23 +00:00
Route::get('/view/{application}', [ApplicationController::class, 'showUserApp'])
->name('showUserApp');
2020-10-08 22:47:23 +00:00
Route::post('/{application}/comments', [CommentController::class, 'insert'])
->name('addApplicationComment');
2020-10-08 22:47:23 +00:00
Route::delete('/comments/{comment}/delete', [CommentController::class, 'delete'])
->name('deleteApplicationComment');
2020-10-08 22:47:23 +00:00
Route::patch('/notes/save/{application}', [AppointmentController::class, 'saveNotes'])
->name('saveNotes');
2020-10-08 22:47:23 +00:00
Route::patch('/update/{application}/{newStatus}', [ApplicationController::class, 'updateApplicationStatus'])
->name('updateApplicationStatus');
2020-10-08 22:47:23 +00:00
Route::delete('{application}/delete', [ApplicationController::class, 'delete'])
->name('deleteApplication');
2020-07-11 01:43:59 +00:00
2020-10-08 22:47:23 +00:00
Route::get('/staff/all', [ApplicationController::class, 'showAllApps'])
->name('allApplications');
2020-07-11 01:43:59 +00:00
2020-05-01 05:21:44 +00:00
2020-10-08 22:47:23 +00:00
Route::get('/staff/outstanding', [ApplicationController::class, 'showAllPendingApps'])
->name('staffPendingApps');
2020-07-11 01:43:59 +00:00
2020-10-08 22:47:23 +00:00
Route::get('/staff/peer-review', [ApplicationController::class, 'showPeerReview'])
->name('peerReview');
2020-07-11 01:43:59 +00:00
2020-05-02 05:54:14 +00:00
2020-10-08 22:47:23 +00:00
Route::get('/staff/pending-interview', [ApplicationController::class, 'showPendingInterview'])
->name('pendingInterview');
2020-07-11 01:43:59 +00:00
2020-10-08 22:47:23 +00:00
Route::post('{application}/staff/vote', [VoteController::class, 'vote'])
->name('voteApplication');
});
Route::group(['prefix' => 'appointments'], function (){
2020-10-08 22:47:23 +00:00
Route::post('schedule/appointments/{application}', [AppointmentController::class, 'saveAppointment'])
->name('scheduleAppointment');
2020-10-08 22:47:23 +00:00
Route::patch('update/appointments/{application}/{status}', [AppointmentController::class, 'updateAppointment'])
->name('updateAppointment');
});
Route::group(['prefix' => 'apply', 'middleware' => ['eligibility']], function (){
2020-10-08 22:47:23 +00:00
Route::get('positions/{vacancySlug}', [ApplicationController::class, 'renderApplicationForm'])
->name('renderApplicationForm');
2020-10-08 22:47:23 +00:00
Route::post('positions/{vacancySlug}/submit', [ApplicationController::class, 'saveApplicationAnswers'])
->name('saveApplicationForm');
});
Route::group(['prefix' => '/profile'], function (){
2020-10-08 22:47:23 +00:00
Route::get('/settings', [ProfileController::class, 'showProfile'])
->name('showProfileSettings');
2020-10-08 22:47:23 +00:00
Route::patch('/settings/save', [ProfileController::class, 'saveProfile'])
->name('saveProfileSettings');
2020-10-08 22:47:23 +00:00
Route::get('user/{user}', [ProfileController::class, 'showSingleProfile'])
->name('showSingleProfile');
2020-10-08 22:47:23 +00:00
Route::get('/settings/account', [UserController::class, 'showAccount'])
->name('showAccountSettings');
2020-10-08 22:47:23 +00:00
Route::patch('/settings/account/change-password', [UserController::class, 'changePassword'])
->name('changePassword');
2020-10-08 22:47:23 +00:00
Route::patch('/settings/account/change-email', [UserController::class, 'changeEmail'])
->name('changeEmail');
2020-10-08 22:47:23 +00:00
Route::post('/settings/account/flush-sessions', [UserController::class, 'flushSessions'])
->name('flushSessions');
2020-07-17 21:44:10 +00:00
2020-10-08 22:47:23 +00:00
Route::patch('/settings/account/twofa/enable', [UserController::class, 'add2FASecret'])
->name('enable2FA');
2020-07-17 21:44:10 +00:00
2020-10-08 22:47:23 +00:00
Route::patch('/settings/account/twofa/disable', [UserController::class, 'remove2FASecret'])
->name('disable2FA');
2020-10-08 22:47:23 +00:00
Route::patch('/settings/account/dg/delete', [UserController::class, 'userDelete'])
->name('userDelete');
});
Route::group(['prefix' => '/hr'], function (){
2020-05-03 03:31:02 +00:00
2020-10-08 22:47:23 +00:00
Route::get('staff-members', [UserController::class, 'showStaffMembers'])
->name('staffMemberList');
2020-10-08 22:47:23 +00:00
Route::get('players', [UserController::class, 'showPlayers'])
->name('registeredPlayerList');
2020-10-08 22:47:23 +00:00
Route::post('players/search', [UserController::class, 'showPlayersLike'])
->name('searchRegisteredPLayerList');
2020-10-08 22:47:23 +00:00
Route::patch('staff-members/terminate/{user}', [UserController::class, 'terminate'])
->name('terminateStaffMember');
});
2020-05-03 04:04:26 +00:00
Route::group(['prefix' => 'admin'], function (){
2020-08-30 22:06:01 +00:00
2020-10-08 22:47:23 +00:00
Route::get('settings', [OptionsController::class, 'index'])
->name('showSettings');
2020-08-30 22:06:01 +00:00
2020-10-08 22:47:23 +00:00
Route::post('settings/save', [OptionsController::class, 'saveSettings'])
->name('saveSettings');
2020-10-08 22:47:23 +00:00
Route::post('players/ban/{user}', [BanController::class, 'insert'])
->name('banUser');
2020-10-08 22:47:23 +00:00
Route::delete('players/unban/{user}', [BanController::class, 'delete'])
->name('unbanUser');
2020-10-08 22:47:23 +00:00
Route::delete('players/delete/{user}', [UserController::class, 'delete'])
->name('deleteUser');
2020-10-08 22:47:23 +00:00
Route::patch('players/update/{user}', [UserController::class, 'update'])
->name('updateUser');
2020-10-08 22:47:23 +00:00
Route::get('positions', [VacancyController::class, 'index'])
->name('showPositions');
2020-10-08 22:47:23 +00:00
Route::post('positions/save', [VacancyController::class, 'store'])
->name('savePosition');
2020-07-11 19:34:26 +00:00
2020-10-08 22:47:23 +00:00
Route::get('positions/edit/{vacancy}', [VacancyController::class, 'edit'])
->name('editPosition');
2020-07-11 19:34:26 +00:00
2020-10-08 22:47:23 +00:00
Route::patch('positions/update/{vacancy}', [VacancyController::class, 'update'])
->name('updatePosition');
2020-07-11 19:34:26 +00:00
2020-10-08 22:47:23 +00:00
Route::patch('positions/availability/{status}/{vacancy}', [VacancyController::class, 'updatePositionAvailability'])
->name('updatePositionAvailability');
2020-05-03 04:04:26 +00:00
2020-10-08 22:47:23 +00:00
Route::get('forms/builder', [FormController::class, 'showFormBuilder'])
->name('showFormBuilder');
2020-05-03 04:04:26 +00:00
2020-10-08 22:47:23 +00:00
Route::post('forms/save', [FormController::class, 'saveForm'])
->name('saveForm');
2020-05-06 23:36:33 +00:00
2020-10-08 22:47:23 +00:00
Route::delete('forms/destroy/{form}', [FormController::class, 'destroy'])
->name('destroyForm');
2020-10-08 22:47:23 +00:00
Route::get('forms', [FormController::class, 'showFormBuilder'])
->name('showForms');
2020-10-08 22:47:23 +00:00
Route::get('forms/preview/{form}', [FormController::class, 'preview'])
->name('previewForm');
2020-10-08 22:47:23 +00:00
Route::get('forms/edit/{form}', [FormController::class, 'edit'])
->name('editForm');
2020-10-08 22:47:23 +00:00
Route::patch('forms/update/{form}', [FormController::class, 'update'])
->name('updateForm');
2020-10-08 22:47:23 +00:00
Route::get('devtools', [DevToolsController::class, 'index'])
->name('devTools');
// we could use route model binding
2020-10-08 22:47:23 +00:00
Route::post('devtools/vote-evaluation/force', [DevToolsController::class, 'forceVoteCount'])
->name('devToolsForceVoteCount');
2020-05-03 04:04:26 +00:00
});
});
});