Skip to content

Commit 548b752

Browse files
committed
register config
1 parent a7d9a52 commit 548b752

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

src/CustomRouteProvider.php

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ final class CustomRouteProvider extends ServiceProvider
1313
*/
1414
public function register(): void
1515
{
16+
$this->registerConfig();
17+
1618
$this->app->singleton('sukristyan.menu', function () {
1719
return new RegisterMenu();
1820
});
@@ -29,14 +31,23 @@ public function boot(): void
2931
});
3032

3133
Route::macro('menu', function (string $label) {
32-
RegisterMenu::add($this->uri(), $label);
34+
/** @var \Illuminate\Routing\Route $this */
35+
RegisterMenu::add($this, $label);
3336
return $this;
3437
});
3538

3639
Route::macro('group', function ($attributes, $routes) {
3740
$result = \Illuminate\Support\Facades\Route::buildGroup($attributes, $routes);
38-
RegisterMenu::endGroupping();
41+
RegisterMenu::endGroup();
3942
return $result;
4043
});
4144
}
45+
46+
public function registerConfig()
47+
{
48+
$this->mergeConfigFrom(
49+
__DIR__ . '/../config/laravel-menu-wrapper.php',
50+
'laravel-menu-wrapper'
51+
);
52+
}
4253
}

0 commit comments

Comments
 (0)