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
|
1 |
|
public function compose(View $view) |
|
|
|
|
19
|
|
|
{ |
20
|
1 |
|
$profileMenu = Lang::get('applicant/applicant_profile_menu'); |
21
|
|
|
|
22
|
1 |
|
$profileMenu['about']['link'] = route('profile.about.edit', $view->getData()['applicant']); |
23
|
1 |
|
$profileMenu['experience']['link'] = route('profile.experience.edit', $view->getData()['applicant']); |
24
|
1 |
|
$profileMenu['skills']['link'] = route('profile.skills.edit', $view->getData()['applicant']); |
25
|
1 |
|
$profileMenu['references']['link'] = route('profile.references.edit', $view->getData()['applicant']); |
26
|
1 |
|
$profileMenu['portfolio']['link'] = route('profile.work_samples.edit', $view->getData()['applicant']); |
27
|
|
|
|
28
|
|
|
//Set active on the proper item |
29
|
1 |
|
switch(Route::currentRouteName()) { |
|
|
|
|
30
|
1 |
|
case('profile.about'): |
|
|
|
|
31
|
1 |
|
case('profile.about.edit'): |
|
|
|
|
32
|
1 |
|
case('profile.about.update'): |
|
|
|
|
33
|
|
|
$profileMenu['about']['active'] = true; |
34
|
|
|
break; |
35
|
1 |
|
case('profile.experience'): |
|
|
|
|
36
|
1 |
|
case('profile.experience.edit'): |
|
|
|
|
37
|
1 |
|
case('profile.experience.update'): |
|
|
|
|
38
|
|
|
$profileMenu['experience']['active'] = true; |
39
|
|
|
break; |
40
|
1 |
|
case('profile.skills'): |
|
|
|
|
41
|
1 |
|
case('profile.skills.edit'): |
|
|
|
|
42
|
|
|
$profileMenu['skills']['active'] = true; |
43
|
|
|
break; |
44
|
1 |
|
case('profile.references'): |
|
|
|
|
45
|
1 |
|
case('profile.references.edit'): |
|
|
|
|
46
|
1 |
|
$profileMenu['references']['active'] = true; |
47
|
1 |
|
break; |
48
|
|
|
case('profile.portfolio'): |
|
|
|
|
49
|
|
|
case('profile.work_samples.edit'): |
|
|
|
|
50
|
|
|
$profileMenu['portfolio']['active'] = true; |
51
|
|
|
break; |
52
|
|
|
default: |
53
|
|
|
//No active menu item |
54
|
|
|
break; |
55
|
|
|
} |
56
|
|
|
|
57
|
1 |
|
$view->with('profile_menu', $profileMenu); |
58
|
1 |
|
} |
59
|
|
|
} |
60
|
|
|
|