|
1
|
|
|
<?php |
|
2
|
|
|
|
|
|
|
|
|
|
3
|
|
|
namespace App\Http\ViewComposers; |
|
4
|
|
|
|
|
5
|
|
|
use Illuminate\View\View; |
|
6
|
|
|
use Illuminate\Support\Facades\Lang; |
|
7
|
|
|
use Illuminate\Support\Facades\Auth; |
|
8
|
|
|
use Illuminate\Support\Facades\Route; |
|
9
|
|
|
|
|
10
|
|
|
class ApplicantProfileMenuComposer |
|
|
|
|
|
|
11
|
|
|
{ |
|
12
|
|
|
/** |
|
13
|
|
|
* Bind data to the view. |
|
14
|
|
|
* |
|
15
|
|
|
* @param View $view |
|
|
|
|
|
|
16
|
|
|
* @return void |
|
|
|
|
|
|
17
|
|
|
*/ |
|
18
|
|
|
public function compose(View $view) |
|
19
|
|
|
{ |
|
20
|
|
|
$profileMenu = [ |
|
21
|
|
|
"about" => [ |
|
22
|
|
|
"active" => false, |
|
23
|
|
|
"link" => route('profile.about.edit', $view->getData()['applicant']), |
|
24
|
|
|
"title" => "Go to the About Me section of your profile.", |
|
25
|
|
|
"label" => "About Me" |
|
26
|
|
|
], |
|
27
|
|
|
"experience" => [ |
|
28
|
|
|
"active" => false, |
|
29
|
|
|
"link" => route('profile.experience.edit', $view->getData()['applicant']), |
|
30
|
|
|
"title" => "Go to the Experience section of your profile.", |
|
31
|
|
|
"label" => "My Experience" |
|
32
|
|
|
], |
|
33
|
|
|
"skills" => [ |
|
34
|
|
|
"active" => false, |
|
35
|
|
|
"link" => route('profile.skills.edit', $view->getData()['applicant']), |
|
36
|
|
|
"title" => "Go to the Skills section of your profile.", |
|
37
|
|
|
"label" => "My Skills" |
|
38
|
|
|
], |
|
39
|
|
|
"references" => [ |
|
40
|
|
|
"active" => false, |
|
41
|
|
|
"link" => route('profile.references.edit', $view->getData()['applicant']), |
|
42
|
|
|
"title" => "Go to the References section of your profile.", |
|
43
|
|
|
"label" => "My References" |
|
44
|
|
|
], |
|
45
|
|
|
"portfolio" => [ |
|
46
|
|
|
"active" => false, |
|
47
|
|
|
"link" =>route('profile.work_samples.edit', $view->getData()['applicant']), |
|
48
|
|
|
"title" => "Go to the Portfolio section of your profile.", |
|
49
|
|
|
"label" => "My Portfolio" |
|
50
|
|
|
] |
|
51
|
|
|
]; |
|
52
|
|
|
|
|
53
|
|
|
//Set active on the proper item |
|
54
|
|
|
switch(Route::currentRouteName()) { |
|
55
|
|
|
case('profile.about'): |
|
56
|
|
|
case('profile.about.edit'): |
|
57
|
|
|
case('profile.about.update'): |
|
58
|
|
|
$profileMenu['about']['active'] = true; |
|
59
|
|
|
break; |
|
60
|
|
|
case('profile.experience'): |
|
61
|
|
|
case('profile.experience.edit'): |
|
62
|
|
|
case('profile.experience.update'): |
|
63
|
|
|
$profileMenu['experience']['active'] = true; |
|
64
|
|
|
break; |
|
65
|
|
|
case('profile.skills'): |
|
66
|
|
|
case('profile.skills.edit'): |
|
67
|
|
|
case('profile.skills.update'): |
|
68
|
|
|
$profileMenu['skills']['active'] = true; |
|
69
|
|
|
break; |
|
70
|
|
|
case('profile.references'): |
|
71
|
|
|
case('profile.references.edit'): |
|
72
|
|
|
case('profile.references.update'): |
|
73
|
|
|
$profileMenu['references']['active'] = true; |
|
74
|
|
|
break; |
|
75
|
|
|
case('profile.portfolio'): |
|
76
|
|
|
case('profile.work_samples.edit'): |
|
77
|
|
|
case('profile.work_samples.update'): |
|
78
|
|
|
$profileMenu['portfolio']['active'] = true; |
|
79
|
|
|
break; |
|
80
|
|
|
default: |
|
81
|
|
|
//No active menu item |
|
82
|
|
|
break; |
|
83
|
|
|
} |
|
84
|
|
|
|
|
85
|
|
|
$view->with('profile_menu', $profileMenu); |
|
86
|
|
|
} |
|
87
|
|
|
} |
|
88
|
|
|
|