Passed
Push — dev ( f2b6b0...c2287c )
by Tristan
09:02 queued 05:05
created

ApplicationTimelineController::complete()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 17
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 11
c 0
b 0
f 0
dl 0
loc 17
rs 9.9
cc 1
nc 1
nop 0
1
<?php
2
3
namespace App\Http\Controllers;
4
5
use App\Http\Controllers\Controller;
6
use App\Models\JobApplication;
7
use App\Models\JobPoster;
8
use Illuminate\Support\Facades\Auth;
9
use Illuminate\Support\Facades\Lang;
10
11
class ApplicationTimelineController extends Controller
12
{
13
    public function show(JobApplication $jobApplication)
14
    {
15
        return view('applicant/application-timeline-root')
0 ignored issues
show
Bug introduced by
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

15
        return /** @scrutinizer ignore-call */ view('applicant/application-timeline-root')
Loading history...
16
            ->with([
17
                'title' => $jobApplication->job_poster->title, // TODO: Check with design what the title should be.
18
                'disable_clone_js' => true,
19
            ]);
20
    }
21
22
    /**
23
     * Show the congrats page after application it's validated and submit.
24
     *
25
     * @param  \App\Models\JobPoster $jobPoster Incoming Job Poster object.
26
     * @return \Illuminate\Http\Response
27
     */
28
    public function complete(/* JobPoster $jobPoster */)
29
    {
30
        // Dummy Data.
31
        $applicant = Auth::user()->applicant;
32
        $jobPoster = JobPoster::where('job_poster_status_id', '10')->first();
33
        $application = JobApplication::where('job_poster_id', $jobPoster->id)->first();
34
35
        return view(
0 ignored issues
show
Bug introduced by
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

35
        return /** @scrutinizer ignore-call */ view(
Loading history...
36
            'applicant/application/10-congrats',
37
            [
38
                'applicant' => $applicant,
39
                'application' => $application,
40
                'application_template' => Lang::get(
41
                    'applicant/application_template',
42
                    ['security_clearance' => $jobPoster->security_clearance->value ]
43
                ),
44
                'jobPoster' => $jobPoster,
45
            ]
46
        );
47
    }
48
}
49