PHPackages                             bagart/laravel-api-provider - 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. [API Development](/categories/api)
4. /
5. bagart/laravel-api-provider

ActiveLibrary[API Development](/categories/api)

bagart/laravel-api-provider
===========================

Test work: Laravel response for location API

02PHP

Since Dec 5Pushed 8y ago1 watchersCompare

[ Source](https://github.com/bagart/test.8bitgroup.com)[ Packagist](https://packagist.org/packages/bagart/laravel-api-provider)[ RSS](/packages/bagart-laravel-api-provider/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Need to implement Symfony3 or Laravel bundle for getting JSON-encoded locations data stored in predefined format.

Acceptance criteria

1. Client should be defined as a service class in a bundle config;
2. Client should utilize CURL as a transport layer (can rely upon any third-party \*\*bundle however should be implemented as a separate class/package);
3. Properly defined exceptions should be thrown on CURL errors, malformed JSON response and error JSON response;
4. Resulting data should be fetched as an array (or other collection) of properly

JSON response format

```
{
    "data": {
        "locations": [
            {
                "name": "Eiffel Tower",
                "coordinates": {
                    "lat": 21.12,
                    "long": 19.56
                }
            },
            ...
        ]
    },
    "success": true
}
```

JSON error response format

```
{
    "data": {
        "message": ,
        "code":
    },
    "success": false
}

```

INSTALL
-------

[](#install)

```
composer require bagart/laravel-api-provider '@dev'
```

Usage
-----

[](#usage)

```
    /**
     * @var \Bagart\LaravelApiProvider\Providers\DataProvider $data_provider
     */
    $data_provider = app(\Bagart\LaravelApiProvider\Providers\DataProvider::class);

    dump($data_provider->request('http://dockerhost/example.json', 'locations'));
    dump($data_provider->request('http://dockerhost/example2.json', 'locations'));
    try {
        $data_provider->request('http://dockerhost/error.json', 'locations');
    } catch (\Bagart\LaravelApiProvider\Exceptions\LaravelApiProviderException $e) {
        dump("LaravelApiProviderException: {$e->getMessage()}");
    }
```

Features
--------

[](#features)

used:

- `Guzzle` (curl inside as options)

Todo
----

[](#todo)

- request empty logic and API empty format
- PHPUnit tests

Tech details
------------

[](#tech-details)

### Contracts

[](#contracts)

- `Bagart\LaravelApiProvider\ApiClientContract`
- `Bagart\LaravelApiProvider\DataProviderContract`
- `Bagart\LaravelApiProvider\DataContainerContract`

Exceptions
----------

[](#exceptions)

All of expected Exception is instance of `Bagart\LaravelApiProvider\Exceptions\LaravelApiProviderException`

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity2

Limited adoption so far

Community7

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/02a582356aa07935e42e622817f56810dce45be995af444215fabb072a39992b?d=identicon)[bagart](/maintainers/bagart)

---

Top Contributors

[![bagart](https://avatars.githubusercontent.com/u/2109022?v=4)](https://github.com/bagart "bagart (1 commits)")

### Embed Badge

![Health badge](/badges/bagart-laravel-api-provider/health.svg)

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

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M454](/packages/google-gax)

PHPackages © 2026

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