menus icon indicating copy to clipboard operation
menus copied to clipboard

Menu Cache?

Open piperone opened this issue 9 years ago • 1 comments

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?

piperone avatar Mar 03 '16 09:03 piperone

No suggestions at all for this?

piperone avatar Nov 26 '16 01:11 piperone