@@ -38,12 +38,12 @@ discard block |
||
38 | 38 | 'title' => __('Launchpad'), |
39 | 39 | ]); |
40 | 40 | |
41 | - foreach(UserMenuJoint::collect() as $joint) { |
|
42 | - foreach ($joint->tools()?: [] as $tool) { |
|
41 | + foreach (UserMenuJoint::collect() as $joint) { |
|
42 | + foreach ($joint->tools() ?: [] as $tool) { |
|
43 | 43 | $this->addTool($tool); |
44 | 44 | } |
45 | 45 | |
46 | - foreach ($joint->entries()?: [] as $entry) { |
|
46 | + foreach ($joint->entries() ?: [] as $entry) { |
|
47 | 47 | $this->addEntry($entry); |
48 | 48 | } |
49 | 49 | } |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | 'item' => ['Logout', 'icon' => 'sign out', 'attr' => ['onclick' => "event.preventDefault();$('#logout-form').submit();"]], |
62 | 62 | 'action' => url('logout'), |
63 | 63 | 'group' => '10000:user', |
64 | - 'callback' => function ($item){ |
|
64 | + 'callback' => function($item) { |
|
65 | 65 | $logoutForm = $item->add(['View', 'attr' => ['method' => 'POST', 'action' => URL::to('logout')]])->setElement('form')->addStyle(['display' => 'none']); |
66 | 66 | $logoutForm->id = 'logout-form'; |
67 | 67 | $logoutForm->add(['View', 'attr' => ['type' => 'hidden', 'name' => '_token', 'value' => csrf_token()]])->setElement('input'); |
@@ -78,14 +78,14 @@ discard block |
||
78 | 78 | |
79 | 79 | public function getUserMenuLabel() |
80 | 80 | { |
81 | - return $this->userMenuLabel?: Auth::user()->name; |
|
81 | + return $this->userMenuLabel ?: Auth::user()->name; |
|
82 | 82 | } |
83 | 83 | |
84 | 84 | public function addEntry($entry) |
85 | 85 | { |
86 | 86 | $entry = collect(array_merge(['item' => $entry, 'group' => '00500:general', 'weight' => 10], $entry)); |
87 | 87 | |
88 | - if (! $entry->get('item')) return; |
|
88 | + if (!$entry->get('item')) return; |
|
89 | 89 | |
90 | 90 | $this->entries->add($entry); |
91 | 91 | } |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | |
114 | 114 | $item = $this->userMenu->addItem($entry['item'], $entry->get('action')); |
115 | 115 | |
116 | - if (! $callback = $entry->get('callback')) continue; |
|
116 | + if (!$callback = $entry->get('callback')) continue; |
|
117 | 117 | |
118 | 118 | $callback($item); |
119 | 119 | } |