rbrecruiter/app/Http/Controllers/ApplicationController.php
Miguel Nogueira 4c6a435e34 Entrypoint: Add Application Page
This commit finally adds the dynamically rendered form that changes according to how the user builds their form.
It also fragments the header and footer for the main page into their own separate files for ease of access later.
Vacancy status has also been added to the Vacancies in DB.
All staff application endpoints have also been moved to under the user application endpoints group, for ease of use (duplicated route group).
2020-05-08 06:06:24 +01:00

63 lines
1.4 KiB
PHP

<?php
namespace App\Http\Controllers;
use App\Vacancy;
use Illuminate\Http\Request;
class ApplicationController extends Controller
{
public function showPendingUserApps()
{
return view('dashboard.user.applications');
}
public function showDeniedUserApps()
{
return view('dashboard.user.deniedapplications');
}
public function showApprovedApps()
{
return view('dashboard.user.approvedapplications');
}
public function showAllPendingApps()
{
return view('dashboard.appmanagement.outstandingapps');
}
public function showPeerReview()
{
return view('dashboard.appmanagement.peerreview');
}
public function showPendingInterview()
{
return view('dashboard.appmanagement.interview');
}
public function renderApplicationForm(Request $request, $vacancySlug)
{
$vacancyWithForm = Vacancy::with('forms')->where('vacancySlug', $vacancySlug)->get();
if (!$vacancyWithForm->isEmpty())
{
return view('dashboard.application-rendering.apply')
->with([
'vacancy' => $vacancyWithForm->first(),
'preprocessedForm' => json_decode($vacancyWithForm->first()->forms->formStructure, true)
]);
}
else
{
abort(404, 'We\'re ssssorry, but the application form you\'re looking for could not be found.');
}
}
}