【问题标题】:Laravel Package for XML API Usage用于 XML API 使用的 Laravel 包
【发布时间】:2020-07-13 17:19:10
【问题描述】:

是否有任何用于 XML Api 使用的 laravel 包? 我正在使用 Laravel 开发一个项目,我开始知道追逐支付网关没有获得 php 的 sdk。 那么有没有什么包可以直接在 laravel 中使用 XML api 呢?

【问题讨论】:

    标签: xml laravel laravel-5 laravel-api chasepayment


    【解决方案1】:

    我为 Laravel 编写了几个有用的 XML 包。

    Response XML: This one adds an xml method to the Response class.

    例如return response()->xml(User::all());

    Request XML: This one lets your api receive an incoming xml request and parse it so it can be run through Laravel's built in validation.

    Collection XML: This one adds an xml method to Laravel's native Collection class.

    如果您准备将数据发送到其他使用 XML 的 API,您可能想要使用这个。您可以将数据加载到集合中并将其转换为 XML。例如。 $collection->toXml();

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-11-14
      • 1970-01-01
      • 1970-01-01
      • 2020-12-16
      • 2021-11-04
      • 2018-07-20
      • 2021-01-01
      • 2021-03-14
      相关资源
      最近更新 更多