Skip to content

Commit 94c2a8b

Browse files
authored
🎨 Improve the Sage example (#73)
1 parent 00ef35c commit 94c2a8b

File tree

1 file changed

+2
-20
lines changed

1 file changed

+2
-20
lines changed

examples/sage/app/View/Composers/Navigation.php

+2-20
Original file line numberDiff line numberDiff line change
@@ -17,28 +17,10 @@ class Navigation extends Composer
1717
];
1818

1919
/**
20-
* Data to be passed to view before rendering.
21-
*
22-
* @return array
23-
*/
24-
public function with()
25-
{
26-
return [
27-
'navigation' => $this->navigation(),
28-
];
29-
}
30-
31-
/**
32-
* Returns the primary navigation.
33-
*
34-
* @return array
20+
* Retrieve the primary navigation menu.
3521
*/
36-
public function navigation()
22+
public function navigation(): array
3723
{
38-
if (Navi::build()->isEmpty()) {
39-
return;
40-
}
41-
4224
return Navi::build()->toArray();
4325
}
4426
}

0 commit comments

Comments
 (0)