File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -42,15 +42,17 @@ public function __construct($navigators = [])
4242 * @param callable $callback
4343 * @return LaravelNavigator
4444 */
45- public function make ($ name = 'default ' , callable $ callback )
45+ public function make ($ name = 'default ' , callable $ callback = null )
4646 {
4747 $ navigator = new LaravelNavigator ($ menu = new NavCollection );
4848
4949 $ this ->navigators ->put ($ name , $ navigator );
5050
5151 $ this ->setCurrent ($ menu );
5252
53- $ callback ($ menu );
53+ if ($ callback ) {
54+ $ callback ($ menu );
55+ }
5456
5557 $ this ->clearCurrent ();
5658
@@ -62,7 +64,7 @@ public function make($name = 'default', callable $callback)
6264 * @param array $items
6365 * @return LaravelNavigator
6466 */
65- public function makeFromArray ($ name = 'default ' , array $ items )
67+ public function makeFromArray ($ name = 'default ' , array $ items = [] )
6668 {
6769 $ factory = new ArrayNavCollectionFactory ($ items );
6870
You can’t perform that action at this time.
0 commit comments