From b39ccc497eadf22f97fb02ed988f1dfeaaa973ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=2E=20Nagy=20Gerg=C5=91?= Date: Mon, 2 Sep 2024 10:40:06 +0200 Subject: [PATCH] wip --- src/Breadcrumbs/Registry.php | 3 ++- src/Interfaces/Breadcrumbs/Registry.php | 24 ++++++++++++++++++++++++ src/Interfaces/Navigation/Registry.php | 18 ++++++++++++++++++ src/Navigation/Registry.php | 4 +++- src/Root.php | 8 ++++---- src/RootServiceProvider.php | 2 ++ 6 files changed, 53 insertions(+), 6 deletions(-) create mode 100644 src/Interfaces/Breadcrumbs/Registry.php create mode 100644 src/Interfaces/Navigation/Registry.php diff --git a/src/Breadcrumbs/Registry.php b/src/Breadcrumbs/Registry.php index 06019ae9..4fd0c4ff 100644 --- a/src/Breadcrumbs/Registry.php +++ b/src/Breadcrumbs/Registry.php @@ -3,10 +3,11 @@ namespace Cone\Root\Breadcrumbs; use Closure; +use Cone\Root\Interfaces\Breadcrumbs\Registry as Contract; use Illuminate\Http\Request; use Illuminate\Routing\Route; -class Registry +class Registry implements Contract { /** * The registered patterns. diff --git a/src/Interfaces/Breadcrumbs/Registry.php b/src/Interfaces/Breadcrumbs/Registry.php new file mode 100644 index 00000000..e06372d4 --- /dev/null +++ b/src/Interfaces/Breadcrumbs/Registry.php @@ -0,0 +1,24 @@ +app = $app; $this->resources = new Resources; $this->widgets = new Widgets; - $this->navigation = new Navigation; - $this->breadcrumbs = new Breadcrumbs; + $this->navigation = $app->make(Navigation::class); + $this->breadcrumbs = $app->make(Breadcrumbs::class); $this->timezone = $app['config']->get('app.timezone'); } diff --git a/src/RootServiceProvider.php b/src/RootServiceProvider.php index 4afdaf6c..3c32b339 100644 --- a/src/RootServiceProvider.php +++ b/src/RootServiceProvider.php @@ -34,11 +34,13 @@ class RootServiceProvider extends ServiceProvider * @var array */ public $bindings = [ + Interfaces\Breadcrumbs\Registry::class => Breadcrumbs\Registry::class, Interfaces\Models\AuthCode::class => Models\AuthCode::class, Interfaces\Models\Medium::class => Models\Medium::class, Interfaces\Models\Meta::class => Models\Meta::class, Interfaces\Models\Notification::class => Models\Notification::class, Interfaces\Models\User::class => Models\User::class, + Interfaces\Navigation\Registry::class => Navigation\Registry::class, ]; /**