承接 cristal/php-api-wrapper 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

cristal/php-api-wrapper

最新稳定版本:v7.0.0

Composer 安装命令:

composer require cristal/php-api-wrapper

包简介

Work with APIs like with Laravel Eloquent or Doctrine (no longer a dream)

README 文档

README

Latest Stable Version GitHub issues GitHub license

PHP API Wrapper is a smart stack based on a couple of a Transport and a smart Wrapper for your API. It is designed to be easily integrated into your projects thanks to bridges for Laravel, Symfony, API Platform and a standalone stack.

🚀 Installation using Composer

composer require cristal/php-api-wrapper

👀 Quick view

<?php

// Configure your API

use Cristal\ApiWrapper\Model;
use Cristal\ApiWrapper\Transports\Basic;
use App\User;
use Curl\Curl;

$transport = new Basic('username', 'password', 'http://api.example.com/v1/', new Curl);
$api = new Api($transport);

Model::setApi($api);

// Use your model like Eloquent (Usage with Symfony is significantly different)

$activedUsers = User::where(['active' => true])->get();

foreach($activedUsers as $user){
    $user->active = false;
    $user->save();
}

📖 Chose your stack

👉 Start without Laravel or Symfony

If you decide to work without Laravel or Symfony, PHP Api Wrapper comes with a standalone Builder and a Model largely inspired by Eloquent, but really standalone. I promise !

Start without Laravel or Symfony

👉 Start with Laravel

This is actualy the powerfull usage of API Wrapper. If you decide to use PHP API Wrapper with Laravel the integration approaches perfection. The builder returns Collections, all models are usable with the Laravel Route Binding (this is really impressive). And icing on the cake, you can create complexes relations between Eloquent and PHP API Wrapper.

Start with Laravel

👉 Start with Symfony (and optionally Api Platform)

This implementation is realy interesting too, the Symfony bridge provide you a Repository implementing the Doctrine RepositoryInterface which hydrates your entities. A Manager is also available which allows you to manage repositories and its connections. If you are using API Platform this is fully compatible. A API Platform Data Provider is also registered.

⚠️ Careful, this implementation is currently read-only. Help us to implement the missing parts !

Start with Symfony

统计信息

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

GitHub 信息

  • Stars: 124
  • Watchers: 10
  • Forks: 33
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-04-08