src/Menu.php
public static function getPackageMenuItems($menu, $user)
    {
        $packageItems = [];

        foreach ($menu['items'] as $i) {
            $item = new Item();
            $item->text = array_key_exists('trans', $i) ? __($i['trans']) : $i['text'];
            $item->url = array_key_exists('route', $i) ? route($i['route']) : url($i['link']);

            if (array_key_exists('permission', $i) && !$user->superAdmin()) {
                if (!$user->hasPermission($i['permission'])) {
                    continue;
                }
            }

            array_push($packageItems, $item);
        }

        return $packageItems;
    }
public static function getPackageMenuItems($menu, $user)
    {
        $packageItems = [];

        foreach ($menu['items'] as $i) {
            $item = new Item();
            $item->text = array_key_exists('trans', $i) ? __($i['trans']) : $i['text'];
            $item->url = array_key_exists('route', $i) ? route($i['route']) : url($i['link']);

            if (array_key_exists('permission', $i) && !$user->superAdmin()) {
                if (!$user->hasPermission($i['permission'])) {
                    continue;
                }
            }

            array_push($packageItems, $item);
        }

        return $packageItems;
    }
public static function getPackageMenuItems ( $ menu , $ user ) { $ packageItems = [ ] ; foreach ( $ menu [ 'items' ] as $ i ) { $ item = new Item ( ) ; $ item -> text = array_key_exists ( 'trans' , $ i ) ? __ ( $ i [ 'trans' ] ) : $ i [ 'text' ] ; $ item -> url = array_key_exists ( 'route' , $ i ) ? route ( $ i [ 'route' ] ) : url ( $ i [ 'link' ] ) ; if ( array_key_exists ( 'permission' , $ i ) && ! $ user -> superAdmin ( ) ) { if ( ! $ user -> hasPermission ( $ i [ 'permission' ] ) ) { continue ; } } array_push ( $ packageItems , $ item ) ; } return $ packageItems ; }
Get package menu Items.

@param [type] $packageMenu [description]
@param [type] $items       [description]

@return [type] [description]
Get package menu Items .