2017 © Pedro Peláez
 

library jacky

Opinionated REST JSON HTTP API client for laravel

image

rap2hpoutre/jacky

Opinionated REST JSON HTTP API client for laravel

  • Saturday, February 6, 2016
  • by rap2hpoutre
  • Repository
  • 1 Watchers
  • 18 Stars
  • 850 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 3 Open issues
  • 8 Versions
  • 30 % Grown

The README.md

Jacky

Packagist Software License Build Status Quality Score SensioLabsInsight, (*1)

JSON API Client for Laravel and Lumen. It's basically just a Guzzle wrapper for JSON, because Guzzle does not care about JSON anymore. And you can configure your endpoints once and for all in a configuration file, could be useful if you work with different services., (*2)

Install

Install via composer, (*3)

composer require rap2hpoutre/jacky

Add Service Provider to config/app.php in providers section, (*4)

Rap2hpoutre\Jacky\ServiceProvider::class,

Then add the facade in aliases section (optional), (*5)

'Jacky' => Rap2hpoutre\Jacky\Facade::class,

Publish configuration, (*6)

php artisan vendor:publish

Usage

Simple example

Let's say foo API returns this on GET /users/1:, (*7)

{
  "data": [{
    "name": "John Doe",
    "email": "john@example.com"
  }]
}

You may get the user like this:, (*8)

$user_name = Jacky::get('foo', '/users/1')->data->first()->name;

Not found example

Let's say foo API returns this on GET /users/2 not found:, (*9)

{
  "errors": [{
    "status": "404",
    "title":  "User not found :/"
  }]
}

You may display error title like this:, (*10)

use Rap2hpoutre\Jacky\Exception\Http404Exception;

try {
    $user = Jacky::get('foo', '/users/1');
} catch (Http404Exception $e) {
    echo $e->errors->first()->title;
}

Configuration

You can learn more about configuration here, (*11)

The Versions

06/02 2016

dev-master

9999999-dev

Opinionated REST JSON HTTP API client for laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar rap2hpoutre

laravel api json lumen rest http client jacky

06/02 2016

v0.0.7

0.0.7.0

Opinionated REST JSON HTTP API client for laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar rap2hpoutre

laravel api json lumen rest http client jacky

05/02 2016

v0.0.6

0.0.6.0

Opinionated REST JSON HTTP API client for laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar rap2hpoutre

laravel api json lumen rest http jacky

05/02 2016

v0.0.5

0.0.5.0

Opinionated REST JSON HTTP API client for laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar rap2hpoutre

laravel api json lumen rest http jacky

03/02 2016

v0.0.4

0.0.4.0

Opinionated REST JSON HTTP API client for laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar rap2hpoutre

laravel api json lumen rest http jacky

03/02 2016

v0.0.3

0.0.3.0

Opinionated REST JSON HTTP API client for laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar rap2hpoutre

laravel api json lumen rest http jacky

17/12 2015

v0.0.2

0.0.2.0

Opinionated REST JSON HTTP API client for laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar rap2hpoutre

laravel api json lumen rest http jacky

04/12 2015

v0.0.1

0.0.1.0

Opinionated REST JSON HTTP API client for laravel

  Sources   Download

MIT

The Requires

 

by Avatar rap2hpoutre

laravel api json rest http jacky