Issues (404)

Branch: dev

app/Http/Controllers/HomepageController.php (4 issues)

1
<?php
2
3
namespace App\Http\Controllers;
4
5
use Illuminate\Support\Facades\Lang;
6
use App\Http\Controllers\Controller;
7
use App\Models\JobPoster;
8
use App\Models\Lookup\JobPosterStatus;
9
10
class HomepageController extends Controller
11
{
12
    /**
13
     * Show the applicant home page.
14 6
     * @return \Illuminate\Http\Response
15
     */
16 6
    public function applicant()
17 6
    {
18 6
        // If true, show the Closed for the Holidays message (complete with snowman).
19
        $christmas_time = config('seasonal.is_christmas_holiday');
0 ignored issues
show
The function config was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

19
        $christmas_time = /** @scrutinizer ignore-call */ config('seasonal.is_christmas_holiday');
Loading history...
20
21
        // If true, show the Paused due to COVID-19 message.
22
        $emergency_response = config('seasonal.is_covid_emergency');
23
24
        // Find three most recent published jobs that are currently open for applications.
25
        // Eager load required relationships: Department, Province, JobTerm.
26 1
        $jobs = JobPoster::where('internal_only', false)
27
            ->where('department_id', '!=', config('app.strategic_response_department_id'))
28 1
            ->where('job_poster_status_id', JobPosterStatus::where('key', 'live')->first()->id)
29
            ->with([
30 1
                'department',
31 1
                'province',
32 1
            ])
33
            ->orderBy('open_date_time', 'desc')
34
            ->take(3)
35
            ->get();
36
        return view('applicant/home', [
0 ignored issues
show
The function view was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

36
        return /** @scrutinizer ignore-call */ view('applicant/home', [
Loading history...
37
            'home' => Lang::get('applicant/home'),
38
            'hero' => Lang::get('common/hero'),
39
            'job_index' => Lang::get('applicant/job_index'),
40
            'job_post' => Lang::get('applicant/job_post'),
41
            'jobs' => $jobs,
42
            'job_count' => count($jobs),
43
            'christmas_time' => $christmas_time,
44
            'emergency_response' => $emergency_response,
45
        ]);
46
    }
47
48
    /**
49
     * Show the manager home page.
50
     * @return \Illuminate\Http\Response
51
     */
52
    public function manager()
53
    {
54
        return view('manager/home', [
0 ignored issues
show
The function view was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

54
        return /** @scrutinizer ignore-call */ view('manager/home', [
Loading history...
55
            'home_l10n' => Lang::get('manager/home'),
56
        ]);
57
    }
58
59
    /**
60
     * Show the hr_advisor home page.
61
     * @return \Illuminate\Http\Response
62
     */
63
    public function hr_advisor() //phpcs:ignore
64
    {
65
        return view('hr_advisor/home', [
0 ignored issues
show
The function view was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

65
        return /** @scrutinizer ignore-call */ view('hr_advisor/home', [
Loading history...
66
            'hr_home' => Lang::get('hr_advisor/home'),
67
        ]);
68
    }
69
}
70