2020-04-27 06:28:00 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
|
2020-05-08 00:45:29 +00:00
|
|
|
use App\Vacancy;
|
2020-04-27 06:28:00 +00:00
|
|
|
use Illuminate\Http\Request;
|
2020-06-26 23:32:33 +00:00
|
|
|
use Illuminate\Support\Facades\DB;
|
2020-04-27 06:28:00 +00:00
|
|
|
|
|
|
|
class HomeController extends Controller
|
|
|
|
{
|
2020-04-29 02:20:00 +00:00
|
|
|
/**
|
|
|
|
* Show the application dashboard.
|
|
|
|
*
|
|
|
|
* @return \Illuminate\Contracts\Support\Renderable
|
|
|
|
*/
|
|
|
|
public function index()
|
|
|
|
{
|
2020-05-08 07:10:25 +00:00
|
|
|
// TODO: Relationships for Applications, Users and Responses
|
|
|
|
// Also prevent apps if user already has one in the space of 30d
|
|
|
|
// Display apps in the relevant menus
|
2020-06-26 23:32:33 +00:00
|
|
|
|
|
|
|
$positions = DB::table('vacancies')
|
|
|
|
->where('vacancyStatus', 'OPEN')
|
|
|
|
->where('vacancyCount', '!=', 0)
|
|
|
|
->get();
|
|
|
|
|
2020-05-08 00:45:29 +00:00
|
|
|
return view('home')
|
2020-06-26 23:32:33 +00:00
|
|
|
->with('positions', $positions);
|
2020-04-29 02:20:00 +00:00
|
|
|
}
|
2020-04-27 06:28:00 +00:00
|
|
|
}
|