private function appendListColumnsFromEvents(string $postType)
    {
        Event::listen(
            'post:table_list_rows', function ($results) use ($postType) {
                $rows = [];

                $inTableColumns = $this->getInTableColumns($postType);

                foreach($results as $key => $item){
                    // title
                    if(array_key_exists('title', $inTableColumns)) {
                        $rows[$key]['title'] = $item->title;
                    }

                    // created at
                    if(array_key_exists('created_at', $inTableColumns)) {
                        $rows[$key]['created_at'] = $item->created_at;
                    }

                }

                return $rows;
            }
        );

        return $this;
    }
private function appendListColumnsFromEvents(string $postType)
    {
        Event::listen(
            'post:table_list_rows', function ($results) use ($postType) {
                $rows = [];

                $inTableColumns = $this->getInTableColumns($postType);

                foreach($results as $key => $item){
                    // title
                    if(array_key_exists('title', $inTableColumns)) {
                        $rows[$key]['title'] = $item->title;
                    }

                    // created at
                    if(array_key_exists('created_at', $inTableColumns)) {
                        $rows[$key]['created_at'] = $item->created_at;
                    }

                }

                return $rows;
            }
        );

        return $this;
    }
private function appendListColumnsFromEvents ( string $ postType ) { Event :: listen ( 'post:table_list_rows' , function ( $ results ) use ( $ postType ) { $ rows = [ ] ; $ inTableColumns = $ this -> getInTableColumns ( $ postType ) ; foreach ( $ results as $ key => $ item ) { // title if ( array_key_exists ( 'title' , $ inTableColumns ) ) { $ rows [ $ key ] [ 'title' ] = $ item -> title ; } // created at if ( array_key_exists ( 'created_at' , $ inTableColumns ) ) { $ rows [ $ key ] [ 'created_at' ] = $ item -> created_at ; } } return $ rows ; } ) ; return $ this ; }
Create event 'table_list_rows' to manipulate with data elsewhere.

@param  string $postType
@return $this
Create event table_list_rows to manipulate with data elsewhere .