Total Complexity | 4 |
Total Lines | 51 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
11 | class BreadcrumbsComposer |
||
12 | { |
||
13 | /** |
||
14 | * The request instance. |
||
15 | * |
||
16 | * @var Request |
||
17 | */ |
||
18 | protected $request; |
||
19 | |||
20 | /** |
||
21 | * Initialize a new composer instance. |
||
22 | * |
||
23 | * @param Request $request Request being made. |
||
24 | * @return void |
||
25 | */ |
||
26 | public function __construct(Request $request) |
||
29 | } |
||
30 | |||
31 | /** |
||
32 | * Bind data to the view. |
||
33 | * |
||
34 | * @param View $view View being rendered. |
||
35 | * |
||
36 | * @return void |
||
37 | */ |
||
38 | public function compose(View $view) |
||
39 | { |
||
40 | $segments = $this->parseSegments(); |
||
41 | $breadcrumbs_lang = Lang::get('common/breadcrumbs')['applicant']; |
||
42 | |||
43 | if (WhichPortal::isManagerPortal()) { |
||
44 | $segments = $segments->slice(1); |
||
45 | $breadcrumbs_lang = Lang::get('common/breadcrumbs')['manager']; |
||
46 | } |
||
47 | |||
48 | $view->with('breadcrumbs', $segments); |
||
49 | $view->with('breadcrumbs_lang', $breadcrumbs_lang); |
||
50 | } |
||
51 | |||
52 | /** |
||
53 | * Parse the request route segments. |
||
54 | * |
||
55 | * @return Collection |
||
56 | */ |
||
57 | protected function parseSegments() |
||
62 | ]; |
||
63 | }); |
||
66 |