Skip to content
Open
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
9 changes: 8 additions & 1 deletion app/Http/Lumberjack.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace App\Http;

use Rareloop\Lumberjack\Http\Lumberjack as LumberjackCore;
use Rareloop\Lumberjack\Facades\Config;
use App\Menu\Menu;

class Lumberjack extends LumberjackCore
Expand All @@ -18,7 +19,13 @@ public function addToContext($context)
// the context, you can get items from it in a way that is a little smoother and more
// versatile than Wordpress's wp_nav_menu. (You need never again rely on a
// crazy "Walker Function!")
$context['menu'] = new Menu('main-nav');

// Auto-register menus from 'config/menus.php'
if (!empty( $menus = Config::get('menus.menus') ) ) {
foreach( $menus as $key => $value ) {
$context[$key] = new Menu( $key );
}
}

return $context;
}
Expand Down