{"id":16817161,"url":"https://github.com/rap2hpoutre/jacky","last_synced_at":"2025-03-22T03:31:22.423Z","repository":{"id":62533276,"uuid":"44438673","full_name":"rap2hpoutre/jacky","owner":"rap2hpoutre","description":":cow2: HTTP JSON API Client for Laravel \u0026 Lumen","archived":false,"fork":false,"pushed_at":"2016-02-08T15:02:49.000Z","size":29,"stargazers_count":17,"open_issues_count":3,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-15T11:16:01.960Z","etag":null,"topics":["api-client","guzzle","json","laravel","lumen","php"],"latest_commit_sha":null,"homepage":"http://twitter.com/rap2h","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rap2hpoutre.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-10-17T13:45:45.000Z","updated_at":"2020-08-12T11:18:37.000Z","dependencies_parsed_at":"2022-11-02T15:15:38.452Z","dependency_job_id":null,"html_url":"https://github.com/rap2hpoutre/jacky","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rap2hpoutre%2Fjacky","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rap2hpoutre%2Fjacky/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rap2hpoutre%2Fjacky/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rap2hpoutre%2Fjacky/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rap2hpoutre","download_url":"https://codeload.github.com/rap2hpoutre/jacky/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244902929,"owners_count":20529114,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api-client","guzzle","json","laravel","lumen","php"],"created_at":"2024-10-13T10:46:23.152Z","updated_at":"2025-03-22T03:31:22.054Z","avatar_url":"https://github.com/rap2hpoutre.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Jacky\n\n[![Packagist](https://img.shields.io/packagist/v/rap2hpoutre/jacky.svg)]()\n[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE)\n[![Build Status](https://img.shields.io/scrutinizer/build/g/rap2hpoutre/jacky.svg?style=flat-square)](https://travis-ci.org/rap2hpoutre/jacky)\n[![Quality Score](https://img.shields.io/scrutinizer/g/rap2hpoutre/jacky.svg?style=flat-square)](https://scrutinizer-ci.com/g/jacky/nestor)\n[![SensioLabsInsight](https://insight.sensiolabs.com/projects/27adcd2f-20de-4555-8753-3ece7ee24495/mini.png)](https://insight.sensiolabs.com/projects/27adcd2f-20de-4555-8753-3ece7ee24495)\n\nJSON API Client for Laravel and Lumen. It's basically just a [Guzzle](https://github.com/guzzle/guzzle) wrapper for JSON, because Guzzle [does not care](http://stackoverflow.com/questions/30530172/guzzle-6-no-more-json-method-for-responses) about JSON anymore. And you can configure your endpoints once and for all in a [configuration file](https://github.com/rap2hpoutre/jacky/blob/master/src/config.php), could be useful if you work with different services.\n## Install\n\nInstall via composer\n```\ncomposer require rap2hpoutre/jacky\n```\nAdd Service Provider to `config/app.php` in `providers` section\n```php\nRap2hpoutre\\Jacky\\ServiceProvider::class,\n```\n\nThen add the facade in `aliases` section (optional) \n```php\n'Jacky' =\u003e Rap2hpoutre\\Jacky\\Facade::class,\n```\n\nPublish configuration\n```\nphp artisan vendor:publish\n```\n\n## Usage\n\n### Simple example\nLet's say foo API returns this on `GET /users/1`: \n```json\n{\n  \"data\": [{\n    \"name\": \"John Doe\",\n    \"email\": \"john@example.com\"\n  }]\n}\n```\n\nYou may get the user like this:\n```php\n$user_name = Jacky::get('foo', '/users/1')-\u003edata-\u003efirst()-\u003ename;\n```\n\n### Not found example\nLet's say foo API returns this on `GET /users/2` not found: \n```json\n{\n  \"errors\": [{\n    \"status\": \"404\",\n    \"title\":  \"User not found :/\"\n  }]\n}\n```\n\nYou may display error title like this:\n```php\nuse Rap2hpoutre\\Jacky\\Exception\\Http404Exception;\n\ntry {\n    $user = Jacky::get('foo', '/users/1');\n} catch (Http404Exception $e) {\n    echo $e-\u003eerrors-\u003efirst()-\u003etitle;\n}\n\n```\n\n## Configuration\nYou can learn more about configuration [here](https://github.com/rap2hpoutre/jacky/blob/master/src/config.php)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frap2hpoutre%2Fjacky","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frap2hpoutre%2Fjacky","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frap2hpoutre%2Fjacky/lists"}