https://github.com/waffler-io/waffler
Declarative HTTP Clients using Guzzle HTTP Library and PHP 8 Attributes
https://github.com/waffler-io/waffler
api api-client api-rest declarative-programming guzzle-php-library guzzlehttp http-client library php php-attibutes php8
Last synced: about 15 hours ago
JSON representation
Declarative HTTP Clients using Guzzle HTTP Library and PHP 8 Attributes
- Host: GitHub
- URL: https://github.com/waffler-io/waffler
- Owner: waffler-io
- License: mit
- Created: 2021-11-21T23:40:53.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2025-08-30T04:08:13.000Z (about 1 month ago)
- Last Synced: 2025-08-30T06:08:13.742Z (about 1 month ago)
- Topics: api, api-client, api-rest, declarative-programming, guzzle-php-library, guzzlehttp, http-client, library, php, php-attibutes, php8
- Language: PHP
- Homepage:
- Size: 682 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README

[](LICENSE)
[](https://packagist.org/packages/waffler/waffler)# Waffler
### How to install?
```shell
$ composer require waffler/waffler
```- This package requires PHP 8 or above.
### How to test?
```shell
$ composer phpunit
```## Quick start
For our example, lets imagine that we want to consume an ordinary API: `https://foo-bar.baz/api`
Our objectives are:
- Perform the login to retrieve the authorization token.
- Retrieve all posts from the database.#### Step 1: Create the basic interface for your client.
```php
'']);// Retrieve the credentials
$credentials = $this->fooClient->login([
'email' => 'email@test.com',
'password' => ''
]);// Retrieve the posts.
$posts = $this->fooClient->getPosts($credentials['token'], ['created_at' => '2020-01-01'])
```## Usage examples
See the [Examples folder](./examples).
## Attributes docs
See the [wiki](https://github.com/waffler-io/waffler/wiki/The-Waffler-Attributes) for more information about the Attributes.