Commit 80f9f907 authored by Nicolas Widart's avatar Nicolas Widart

Adding a sidebar view composer

parent d4654fd3
<?php namespace Modules\Dashboard\Composers;
class SidebarViewComposer
{
public function compose($view)
{
$view->items->put('dashboard', [
'weight' => 0,
'request' => $view->prefix,
'route' => 'dashboard.index',
'icon-class' => 'fa fa-dashboard',
'title' => 'Dashboard',
]);
}
}
\ No newline at end of file
......@@ -2,5 +2,5 @@
Route::group(['prefix' => Config::get('core::core.admin-prefix'), 'namespace' => 'Modules\Dashboard\Http\Controllers'], function()
{
Route::get('/', 'Admin\DashboardController@index');
Route::get('/', ['as' => 'dashboard.index', 'uses' => 'Admin\DashboardController@index']);
});
\ No newline at end of file
<?php
View::composer('core::partials.sidebar-nav', 'Modules\Dashboard\Composers\SidebarViewComposer');
\ No newline at end of file
......@@ -25,4 +25,6 @@ Config::addNamespace('dashboard', __DIR__ . '/Config/');
|
*/
require __DIR__ . '/Http/routes.php';
\ No newline at end of file
require __DIR__ . '/Http/routes.php';
require __DIR__ . '/composers.php';
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment