Skip to content

Commit

Permalink
🎨 Improve the Sage example
Browse files Browse the repository at this point in the history
  • Loading branch information
Log1x committed Mar 18, 2024
1 parent 00ef35c commit 20d450c
Showing 1 changed file with 2 additions and 20 deletions.
22 changes: 2 additions & 20 deletions examples/sage/app/View/Composers/Navigation.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,28 +17,10 @@ class Navigation extends Composer
];

/**
* Data to be passed to view before rendering.
*
* @return array
*/
public function with()
{
return [
'navigation' => $this->navigation(),
];
}

/**
* Returns the primary navigation.
*
* @return array
* Retrieve the primary navigation menu.
*/
public function navigation()
public function navigation(): array
{
if (Navi::build()->isEmpty()) {
return;
}

return Navi::build()->toArray();
}
}

0 comments on commit 20d450c

Please sign in to comment.