定制 alphaolomi/json-placeholder 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

alphaolomi/json-placeholder

最新稳定版本:v2.0.0

Composer 安装命令:

composer require alphaolomi/json-placeholder

包简介

This is my package json-placeholder

README 文档

README

Latest Version on Packagist Tests Total Downloads

A PHP SDK for the JSON Placeholder API.

Installation

You can install the package via composer:

composer require alphaolomi/json-placeholder

Usage

$api = new Json\Api();

$users = $api->users()->list();

foreach($users as $user) {
    echo $user->name;
}

Shorthand

$users =  (new Json\Api())->users()->list();

print_r($users);

// array:10 [
//   0 => array:8 [
//     "id" => 1
//     "name" => "Leanne Graham"
//     "username" => "Bret"
//     "email" => "Sincere@april.biz"
//     "address" => array:5 [▶]
//     "phone" => "1-770-736-8031 x56442"
//     "website" => "hildegard.org"
//     "company" => array:3 [▶]
//   ]
//   1 => array:8 [▶]
// ]

Paginated Results

You may prefer to retrieve all the results from the paginated requests by using the paginator method on the SDK.

$api = new Json\Api();

$results = $api->users()->paginate();

foreach($results as $result) {
    // Handle result
    echo $result->name;
}

Available Resources

  • Users
    • List all users
    • Get a single user
    • Create a user
    • Update a user
    • Delete a user
    • Paginate users

Testing

Using PestPHP Testing framework, run the following command to execute the tests.

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 17
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 12
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 12
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-03-08

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固