Skip to content
This repository has been archived by the owner on May 31, 2019. It is now read-only.

Add closure support to menus #2

Merged
merged 4 commits into from
Jun 24, 2016
Merged

Add closure support to menus #2

merged 4 commits into from
Jun 24, 2016

Conversation

ThamanVelasquezBice
Copy link
Contributor

@ThamanVelasquezBice ThamanVelasquezBice commented Jun 24, 2016

I added support for the 'items' array to accept a closure. I tried to use just the closure without editing your code, but php gave me a segmentation fault.

'items' => [
    // This menu will be shown regardless of whether or not
    // the login system is enabled!
    function() {
        if(auth()->user()->hasRole('developer')) 
        {
             return ['Admin Stuff' => ['link' =>'some/cool/route', 'icon' => 'fa fa-user']];
        }
    },
    'Like Things?' => [
        'link' => '#',
        'icon' => 'fa fa-line-chart',
    ],
],

@austinkregel austinkregel merged commit c172806 into austinkregel:master Jun 24, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants