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

        // Find posts
        $postsObj = (new Post())->setTable($postType);

        $postsObj = $postsObj->published();
        if(Input::input('keyword')) {
            $postsObj->where('title->'.App::getLocale(), 'like', '%'.Input::input('keyword').'%');
        }
        $postsObj->orderBy('created_at', 'DESC');
        $posts = $postsObj->paginate(25);

        // Append menuLink Parameters
        foreach($posts->all() as $post){
            $post->setAutoTranslate(false);
            $post->belongsTo = $postType;
            $post->belongsToID = $post->postID;
            $post->label = $post->title;
            $post->menuLinkParameters = $post->menuLinkParameters();
        }

        // Append columns
        $results = $posts->toArray();
        $results['columns']= [
            'postID' => trans('id'),
            'title' => trans('base.title'),
        ];

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

        // Find posts
        $postsObj = (new Post())->setTable($postType);

        $postsObj = $postsObj->published();
        if(Input::input('keyword')) {
            $postsObj->where('title->'.App::getLocale(), 'like', '%'.Input::input('keyword').'%');
        }
        $postsObj->orderBy('created_at', 'DESC');
        $posts = $postsObj->paginate(25);

        // Append menuLink Parameters
        foreach($posts->all() as $post){
            $post->setAutoTranslate(false);
            $post->belongsTo = $postType;
            $post->belongsToID = $post->postID;
            $post->label = $post->title;
            $post->menuLinkParameters = $post->menuLinkParameters();
        }

        // Append columns
        $results = $posts->toArray();
        $results['columns']= [
            'postID' => trans('id'),
            'title' => trans('base.title'),
        ];

        return $results;
    }
public function menuPanelItems ( $ lang = "" , $ postType ) { // check if user has permissions to access this link if ( ! User :: hasAccess ( 'PostType' , 'read' ) ) { return $ this -> noPermission ( ) ; } // Find posts $ postsObj = ( new Post ( ) ) -> setTable ( $ postType ) ; $ postsObj = $ postsObj -> published ( ) ; if ( Input :: input ( 'keyword' ) ) { $ postsObj -> where ( 'title->' . App :: getLocale ( ) , 'like' , '%' . Input :: input ( 'keyword' ) . '%' ) ; } $ postsObj -> orderBy ( 'created_at' , 'DESC' ) ; $ posts = $ postsObj -> paginate ( 25 ) ; // Append menuLink Parameters foreach ( $ posts -> all ( ) as $ post ) { $ post -> setAutoTranslate ( false ) ; $ post -> belongsTo = $ postType ; $ post -> belongsToID = $ post -> postID ; $ post -> label = $ post -> title ; $ post -> menuLinkParameters = $ post -> menuLinkParameters ( ) ; } // Append columns $ results = $ posts -> toArray ( ) ; $ results [ 'columns' ] = [ 'postID' => trans ( 'id' ) , 'title' => trans ( 'base.title' ) , ] ; return $ results ; }
Get posts to be displayed in menu panel.

@param  string $lang
@param  string $postType Slug of post type
@return array
Get posts to be displayed in menu panel .