Code Duplication    Length = 9-26 lines in 3 locations

app/Http/Controllers/ApplicantProfileController.php 1 location

@@ 28-53 (lines=26) @@
25
     * @param  \App\Models\Applicant $applicant
26
     * @return \Illuminate\View\View|\Illuminate\Contracts\View\Factory
27
     */
28
    public function show(Request $request, Applicant $applicant)
29
    {
30
        //TODO:
31
        //Josh, to loop through answers&question data, leverage this data structure:
32
        // applicant
33
        //     [applicant_profile_answers]
34
        //         answer
35
        //         applicant_profile_question
36
        //             id
37
        //             value // The question text
38
        //             description // Question description text
39
40
        return view(
41
            'manager/applicant_profile',
42
            [
43
                /* Localization Strings*/
44
                'profile' => Lang::get('manager/applicant_profile'), // Change text
45
46
                /* User Data */
47
                'user' => $applicant->user,
48
                'applicant' => $applicant,
49
                'profile_photo_url' => '/images/user.png', //TODO: get real photos
50
            ]
51
        );
52
    }
53
54
    /**
55
     * Show the form for editing the logged-in applicant's profile
56
     *

app/Http/Controllers/ExperienceController.php 1 location

@@ 38-46 (lines=9) @@
35
    *
36
    * @return \Illuminate\View\View|\Illuminate\Contracts\View\Factory
37
    */
38
    public function edit(Request $request, Applicant $applicant)
39
    {
40
        return view('applicant/profile_02_experience', [
41
            'applicant' => $applicant,
42
            'profile' => Lang::get('applicant/profile_experience'),
43
            'work_template' => Lang::get('common/work_experience'),
44
            'form_submit_action' => route('profile.experience.update', $applicant)
45
        ]);
46
    }
47
48
    /**
49
     * Update the applicant's profile in storage.

app/Http/Controllers/SkillDeclarationController.php 1 location

@@ 40-52 (lines=13) @@
37
     *
38
     * @return \Illuminate\View\View|\Illuminate\Contracts\View\Factory
39
     */
40
    public function edit(Request $request, Applicant $applicant)
41
    {
42
        $applicant->load([
43
            'skill_declarations.skill.skill_type',
44
            'skill_declarations.skill_status',
45
            'skill_declarations.skill_level',
46
        ]);
47
48
        return view('applicant/profile_03_skills', [
49
            'applicant' => $applicant,
50
            'profile' => Lang::get('applicant/profile_skills'),
51
        ]);
52
    }
53
54
    /**
55
     * Create the particular skill declaration in storage.