app/Http/Resources/NewsCardListResource.php
/**
     * Transform the resource into an array.
     *
     * @param Request $request
     * @return array
     */
Transform the resource into an array.
@param Request $request
@return array
Transform the resource into an array . @param Request $request @return array
public function toArray($request)
    {
        return [
            'items' => NewsCardResource::collection($this->items()),
            'hasMore' => $this->nextPageUrl() ? true : false
        ];
    }
public function toArray ( $ request ) { return [ 'items' => NewsCardResource :: collection ( $ this -> items ( ) ) , 'hasMore' => $ this -> nextPageUrl ( ) ? true : false ] ; }
Transform the resource into an array.
Transform the resource into an array .