Vespakoen/laravel-menu — pull request #38 by Vespakoen (2013-09-16 20:48:01+00:00)
Title: Allow the handler to manage ItemLists AND Items

**Whut!?**
As I already mentioned in the roadmap issue, I have recreated some parts of the Menu bundle and I want to merge those in to the existing codebase.

I will try to make a new branch for every change so things stay clear, and I will make a pull request for all of the changes so we can discuss if the change is a good thing in to begin with.

This is a work in progress, it is basically a rough copy & paste from the code I wrote seperately, so don't expect this to work soon.

**The change**
1) The handlers are no longer stored in the Menu class, this allows for easier debugging, for example:
```php
$menu = Menu::handler('with-some-name')->add('some', 'link');
dd($menu);
```
Would previously return a Handler instance with a "with-some-name" handle, but wouln't show the actual links that it contained, for this you would have to `dd()` the Menu::getItemList('with-some-name') which isn't really intuitive.

2) The handler is now free to handle any kinds of objects, but in general this will only be `ItemList` and `Item` instances (MenuObjects)

3) Responses of forwarded calls will be combined and returned in the appropriate format.

4) A `$override` property is added to indicate methods that change the MenuObject, other methods that are not in this list will be executed in a non-destructive manner.

**Let me know what you guys think!**