public function menuPanelItems($lang = "")
    {
        // check if user has permissions to access this link
        if(!User::hasAccess('PostType', 'read')) {
            return $this->noPermission();
        }

        // Find categories
        $categoryObj = Category::visible();
        if(Input::input('keyword')) {
            $categoryObj->where('title', 'like', '%'.Input::input('keyword').'%');
        }
        $categoryObj->orderBy('postTypeID', 'ASC');
        $categories = $categoryObj->paginate(25);

        // Append menuLink Parameters
        foreach($categories->all() as $category){
            $postTypeData = PostType::findByID($category->postTypeID);
            $category->postTypeName = $postTypeData->name;
            $category->belongsTo = 'category';
            $category->belongsToID = $category->categoryID;
            $category->label = $category->title;
            $category->menuLinkParameters = $category->menuLinkParameters();
        }

        // Append columns
        $results = $categories->toArray();
        $results['columns']= [
            'categoryID' => trans('id'),
            'title' => trans('base.title'),
            'postTypeName' => trans('postTypes.title'),
        ];

        return $results;
    }
public function menuPanelItems($lang = "")
    {
        // check if user has permissions to access this link
        if(!User::hasAccess('PostType', 'read')) {
            return $this->noPermission();
        }

        // Find categories
        $categoryObj = Category::visible();
        if(Input::input('keyword')) {
            $categoryObj->where('title', 'like', '%'.Input::input('keyword').'%');
        }
        $categoryObj->orderBy('postTypeID', 'ASC');
        $categories = $categoryObj->paginate(25);

        // Append menuLink Parameters
        foreach($categories->all() as $category){
            $postTypeData = PostType::findByID($category->postTypeID);
            $category->postTypeName = $postTypeData->name;
            $category->belongsTo = 'category';
            $category->belongsToID = $category->categoryID;
            $category->label = $category->title;
            $category->menuLinkParameters = $category->menuLinkParameters();
        }

        // Append columns
        $results = $categories->toArray();
        $results['columns']= [
            'categoryID' => trans('id'),
            'title' => trans('base.title'),
            'postTypeName' => trans('postTypes.title'),
        ];

        return $results;
    }
public function menuPanelItems ( $ lang = "" ) { // check if user has permissions to access this link if ( ! User :: hasAccess ( 'PostType' , 'read' ) ) { return $ this -> noPermission ( ) ; } // Find categories $ categoryObj = Category :: visible ( ) ; if ( Input :: input ( 'keyword' ) ) { $ categoryObj -> where ( 'title' , 'like' , '%' . Input :: input ( 'keyword' ) . '%' ) ; } $ categoryObj -> orderBy ( 'postTypeID' , 'ASC' ) ; $ categories = $ categoryObj -> paginate ( 25 ) ; // Append menuLink Parameters foreach ( $ categories -> all ( ) as $ category ) { $ postTypeData = PostType :: findByID ( $ category -> postTypeID ) ; $ category -> postTypeName = $ postTypeData -> name ; $ category -> belongsTo = 'category' ; $ category -> belongsToID = $ category -> categoryID ; $ category -> label = $ category -> title ; $ category -> menuLinkParameters = $ category -> menuLinkParameters ( ) ; } // Append columns $ results = $ categories -> toArray ( ) ; $ results [ 'columns' ] = [ 'categoryID' => trans ( 'id' ) , 'title' => trans ( 'base.title' ) , 'postTypeName' => trans ( 'postTypes.title' ) , ] ; return $ results ; }
Get categories to be displayed in menu panel.

@param  string $lang
@return array
Get categories to be displayed in menu panel .