protected function setCartItems($items)
    {
        return (new Collection($items))->map(function ($item, $num) {
            return [
                'L_PAYMENTREQUEST_0_NAME'.$num => $item['name'],
                'L_PAYMENTREQUEST_0_AMT'.$num  => $item['price'],
                'L_PAYMENTREQUEST_0_QTY'.$num  => isset($item['qty']) ? $item['qty'] : 1,
            ];
        })->flatMap(function ($value) {
            return $value;
        });
    }
protected function setCartItems($items)
    {
        return (new Collection($items))->map(function ($item, $num) {
            return [
                'L_PAYMENTREQUEST_0_NAME'.$num => $item['name'],
                'L_PAYMENTREQUEST_0_AMT'.$num  => $item['price'],
                'L_PAYMENTREQUEST_0_QTY'.$num  => isset($item['qty']) ? $item['qty'] : 1,
            ];
        })->flatMap(function ($value) {
            return $value;
        });
    }
protected function setCartItems ( $ items ) { return ( new Collection ( $ items ) ) -> map ( function ( $ item , $ num ) { return [ 'L_PAYMENTREQUEST_0_NAME' . $ num => $ item [ 'name' ] , 'L_PAYMENTREQUEST_0_AMT' . $ num => $ item [ 'price' ] , 'L_PAYMENTREQUEST_0_QTY' . $ num => isset ( $ item [ 'qty' ] ) ? $ item [ 'qty' ] : 1 , ] ; } ) -> flatMap ( function ( $ value ) { return $ value ; } ) ; }
Set cart item details for PayPal.

@param array $items

@return \Illuminate\Support\Collection
Set cart item details for PayPal .