PHPackages                             media24si/api-resource - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. media24si/api-resource

ActiveLibrary[HTTP &amp; Networking](/categories/http)

media24si/api-resource
======================

Laravel Guzzle Api Resource Package

v3.0.1(2y ago)82.5k↓100%2MITPHPPHP ^8.0

Since May 27Pushed 2y ago1 watchersCompare

[ Source](https://github.com/Media24si/ApiResource)[ Packagist](https://packagist.org/packages/media24si/api-resource)[ Docs](https://github.com/Media24si/ApiResource)[ RSS](/packages/media24si-api-resource/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (2)Versions (10)Used By (0)

Api Resource
============

[](#api-resource)

[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)

A simple Guzzle wrapper, providing easy access to API endpoints.

**For Guzzle v5.0 support use v1.0.0**

Install - Laravel
-----------------

[](#install---laravel)

Require this package with Composer (Packagist), using the following command:

```
$ composer require media24si/api-resource
```

Register the ApiResourceServiceProvider to the providers array in `config/app.php`:

```
Media24si\ApiResource\ApiResourceServiceProvider::class,
```

Publish vendor files (config file):

```
$ php artisan vendor:publish
```

**Optional**Register the facade in `config/app.php`:

```
'Api' => Media24si\ApiResource\Facades\ApiResource::class
```

Install - Lumen
---------------

[](#install---lumen)

Require this package with Composer (Packagist), using the following command:

```
$ composer require media24si/api-resource
```

Register the ApiResourceServiceProvider inside `bootstrap/app.php` (Lumen):

```
$app->register(Media24si\ApiResource\ApiResourceServiceProvider::class);
```

Copy the config file from the vendor `vendor/media24si/api-resource/src/config/apiresrouce.php` to your local config folder `config/apiresource.php` and enable the config inside your `bootstrap/app.php` (Lumen):

```
$app->configure('apiresource');
```

**Optional**Register the facade in `bootstrap/app.php` (Lumen):

```
class_alias(Media24si\ApiResource\Facades\ApiResource::class, 'Api');
```

also, make sure you uncomment this line from the same file:

```
$app->withFacades();
```

Usage
-----

[](#usage)

You can use this package without any configuration. Just use the \\Api facade in your controller (or inject Media24si\\ApiResource\\ApiResource in your function/controller).

Call your endpoints, like you would a normal Guzzle request:

```
\Api::get('http://httpbin.org'); // returns a response object
```

Config
------

[](#config)

#### defaults

[](#defaults)

Associative array of Request Options, that are applied to every request, created by the client. See the official [manual](http://guzzle.readthedocs.org/en/latest/quickstart.html#creating-a-client) .

Example:

```
'defaults' => [
	'base_uri' => 'http://httpbin.org/']
]

#### endpoints
Array of defined endpoints. Here you can define your aliases for endpoints.

Sample array:
``` php
'endpoints' => [
	'notification' => [
		'uri' => 'http://httpbin.org/notification'
	],
	'categories' => [
		'uri' => '/categories', // with base_uri set
		'options' => [
			'query' => [
				'fields' => 'id, title'
			]
		]
	]
]
```

With endpoints defined you can make simple calls. A sample would be:

```
\Api::get('notification')
```

Default options can be overridden:

```
\Api::get('categories', ['query' => ['fields' => 'id, title, slug']])
```

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

36

—

LowBetter than 81% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity74

Established project with proven stability

 Bus Factor1

Top contributor holds 85% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~394 days

Total

9

Last Release

844d ago

Major Versions

v1.0.0 → v2.0.02016-02-02

v2.0.6 → v3.02022-09-22

PHP version history (3 changes)v1.0.0PHP &gt;=5.4.0

v2.0.4PHP &gt;=7.0

v3.0PHP ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/17848fce32bf9d0ecfb9427ab0e842794bdd8b2c26eec791e5dad8d33b8703b5?d=identicon)[BostjanOb](/maintainers/BostjanOb)

---

Top Contributors

[![BostjanOb](https://avatars.githubusercontent.com/u/650818?v=4)](https://github.com/BostjanOb "BostjanOb (34 commits)")[![Neoglyph](https://avatars.githubusercontent.com/u/5198992?v=4)](https://github.com/Neoglyph "Neoglyph (6 commits)")

---

Tags

laravelGuzzlerest-client

### Embed Badge

![Health badge](/badges/media24si-api-resource/health.svg)

```
[![Health](https://phpackages.com/badges/media24si-api-resource/health.svg)](https://phpackages.com/packages/media24si-api-resource)
```

###  Alternatives

[kozz/laravel-guzzle-provider

Guzzle 5/6 Service Provider for Laravel

621.1M2](/packages/kozz-laravel-guzzle-provider)[wppconnect-team/wppconnect-laravel-client

A simple API with Guzzle wrapper, providing easy access to wppconnect's endpoints.

403.4k](/packages/wppconnect-team-wppconnect-laravel-client)[onlime/laravel-http-client-global-logger

A global logger for the Laravel HTTP Client

1935.1k](/packages/onlime-laravel-http-client-global-logger)[pingpong/facebook

Facebook OAuth v4 for Laravel Framework

1129.7k](/packages/pingpong-facebook)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
