menus
menus copied to clipboard
Menu Cache?
Do you have any suggestions with regards to handling caching a menu with this package? I recently had to move away from the "file-based" way of adding menuitems and put them inside a DB instead. Now I'd like to eliminate the extra queries and, if possible, the menu-building process for each request instead. My menu doesn't change that often anyway so, cacheing seems like a good idea to me.
I tried the most straightforward approach first:
$myMenu = Cache::remember('menu', $minutes, function(){
return Menu::make('myMenu', function(){
//
});
})
But this results in:
Exception in FileStore.php line 100:
Serialization of 'Closure' is not allowed
Is there a good way to achieve this, or something similar?
No suggestions at all for this?