From 94c2a8bfca514c898cf660a17afbc125600614a6 Mon Sep 17 00:00:00 2001 From: Brandon Date: Mon, 18 Mar 2024 07:38:45 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20Improve=20the=20Sage=20example?= =?UTF-8?q?=20(#73)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sage/app/View/Composers/Navigation.php | 22 ++----------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/examples/sage/app/View/Composers/Navigation.php b/examples/sage/app/View/Composers/Navigation.php index 3d3f437..290249a 100644 --- a/examples/sage/app/View/Composers/Navigation.php +++ b/examples/sage/app/View/Composers/Navigation.php @@ -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(); } }