Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions config/menu.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?php

return [
'prepend' => 'menu_'
];
2 changes: 1 addition & 1 deletion src/Menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public function make($name, $callback)

$this->collection->put($name, $menu);

$this->view->share('menu_'.$name, $menu);
$this->view->share(config('menu.prepend','menu_').$name, $menu);

return $menu;
}
Expand Down
11 changes: 11 additions & 0 deletions src/MenusServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@

class MenusServiceProvider extends ServiceProvider {

public function boot()
{
$this->publishConfig();
}
/**
* Indicates if loading of the provider is deferred.
*
Expand Down Expand Up @@ -47,4 +51,11 @@ protected function registerServices()
return new Menu($app['config'], $app['view'], $app['html'], $app['url']);
});
}

protected function publishConfig()
{
$this->publishes([
__DIR__ . '/../config/menu.php' => config_path('menu.php'),
], 'caffeinated-menu');
}
}