PHPackages                             basemkhirat/api - 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. basemkhirat/api

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

basemkhirat/api
===============

Making API calls from laravel applications

45251PHP

Since Dec 6Pushed 8y ago2 watchersCompare

[ Source](https://github.com/basemkhirat/api)[ Packagist](https://packagist.org/packages/basemkhirat/api)[ RSS](/packages/basemkhirat-api/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

### A guzzle interface to make API calls for laravel 5 applications.

[](#a-guzzle-interface-to-make-api-calls-for-laravel-5-applications)

##### 1) Install package via composer:

[](#1-install-package-via-composer)

```
composer require basemkhirat/api

```

##### 2) Add package service provider:

[](#2-add-package-service-provider)

```
Basemkhirat\API\APIServiceProvider::class

```

##### 3) Add package alias:

[](#3-add-package-alias)

```
'API' => Basemkhirat\API\Facades\API::class

```

##### 4) Publishing:

[](#4-publishing)

```
php artisan vendor:publish

```

### Usage:

[](#usage)

#### Requests with request uri:

[](#requests-with-request-uri)

```
// $config is optional

GET Request     :  API::get("users/show", $config)
POST Request    :  API::post("users/create", $config)
PUT Request     :  API::put("users/update", $config)
DELETE Request  :  API::delete("users/delete", $config)

```

#### Or using full url:

[](#or-using-full-url)

```
// $config is optional

GET Request     :  API::get("http://httpbin.org/get", $config)
POST Request    :  API::post("http://httpbin.org/post", $config)
PUT Request     :  API::put("http://httpbin.org/put", $config)
DELETE Request  :  API::delete("http://httpbin.org/delete", $config)

```

#### Getting body content text:

[](#getting-body-content-text)

```
API::get("get", $config)->getBody()->getContent()

```

#### Getting body content array:

[](#getting-body-content-array)

```
API::get("get", $config)->toArray()

```

#### Getting status code:

[](#getting-status-code)

```
API::get("get", $config)->getStatusCode()   // int 200

```

#### Multiple drivers:

[](#multiple-drivers)

In api.php config file, repeat `default` array block

```
 return [

     // Called using API::driver("default")->get($uri) or API::get($uri) directly

     "default" => [
        'base_uri' => 'http://site1.dev/api/',
        ....
        ...
        .
     ],

     // Called using API::driver("another")->get($uri)

     "another" => [
        'base_uri' => 'http://site2.dev/api/',
        ....
        ...
        .
      ]
 ];

```

#### Native guzzle calling:

[](#native-guzzle-calling)

```
//API::guzzle() return guzzle client object

API::guzzle()->get("get", $config)->getBody()->getContents();

```

For more guzzle request options

Browse Guzzle docs : [Guzzle Docs](http://docs.guzzlephp.org/en/latest/request-options.html#allow-redirects)

`Good luck`

`Dont forget to send a feedback..`

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/afd0bd44516aababd30385fc3591578e660fb88f9516ceb6d5b638b0700fd99f?d=identicon)[basemkhirat](/maintainers/basemkhirat)

---

Top Contributors

[![basemkhirat](https://avatars.githubusercontent.com/u/1637218?v=4)](https://github.com/basemkhirat "basemkhirat (9 commits)")

---

Tags

apiguzzleguzzle-interfacehttp-client

### Embed Badge

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

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

###  Alternatives

[friendsofsymfony/rest-bundle

This Bundle provides various tools to rapidly develop RESTful API's with Symfony

2.8k73.3M319](/packages/friendsofsymfony-rest-bundle)[php-http/discovery

Finds and installs PSR-7, PSR-17, PSR-18 and HTTPlug implementations

1.3k309.5M1.2k](/packages/php-http-discovery)[nyholm/psr7

A fast PHP7 implementation of PSR-7

1.3k235.4M2.4k](/packages/nyholm-psr7)[pusher/pusher-php-server

Library for interacting with the Pusher REST API

1.5k94.8M293](/packages/pusher-pusher-php-server)[spatie/crawler

Crawl all internal links found on a website

2.8k16.3M52](/packages/spatie-crawler)[react/http

Event-driven, streaming HTTP client and server implementation for ReactPHP

78126.4M414](/packages/react-http)

PHPackages © 2026

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