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

ActiveLibrary[API Development](/categories/api)

bwt-team/laravel-api
====================

Package helping with API development

v1.1.8(3y ago)210.7k↓58.3%MITPHPPHP ^8.0.2

Since Jan 28Pushed 3y ago2 watchersCompare

[ Source](https://github.com/groupbwt/laravel-api)[ Packagist](https://packagist.org/packages/bwt-team/laravel-api)[ RSS](/packages/bwt-team-laravel-api/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (3)Versions (14)Used By (0)

English description | [Russian description](README_RU.md)

Laravel 5 API
=============

[](#laravel-5-api)

[![Latest Stable Version](https://camo.githubusercontent.com/3710a3e7e9f5b58c778203410042175210b340967237c1286d688320d6e4c0db/68747470733a2f2f706f7365722e707567782e6f72672f6277742d7465616d2f6c61726176656c2d6170692f762f737461626c653f666f726d61743d666c61742d737175617265)](https://packagist.org/packages/bwt-team/laravel-api)[![Latest Unstable Version](https://camo.githubusercontent.com/cb95d9686afbee1f2214d918219496a0b69c4c1982ef19e10f624e9627e9609d/68747470733a2f2f706f7365722e707567782e6f72672f6277742d7465616d2f6c61726176656c2d6170692f762f756e737461626c653f666f726d61743d666c61742d737175617265)](https://packagist.org/packages/bwt-team/laravel-api#dev-develop)[![License](https://camo.githubusercontent.com/150bfcde28141d9f7bdf9b8add39f8a053592ca9d8e4427efe2e1c7ac140e3ed/68747470733a2f2f706f7365722e707567782e6f72672f6277742d7465616d2f6c61726176656c2d6170692f6c6963656e73653f666f726d61743d666c61742d737175617265)](LICENSE.md)

This package allows to easily and quickly setup basics for API.

### Content

[](#content)

- [Installation](#installation)
- [Setup in Laravel](#setup-in-laravel)
- [Setup in Lumen](#setup-in-lumen)
- [License](#license)

### Installation

[](#installation)

Install this package with composer using the following command:

```
composer require bwt-team/laravel-api
```

### Setup in Laravel

[](#setup-in-laravel)

When composer updated, add service provider into `providers` array in `config/app.php`.

```
BwtTeam\LaravelAPI\Providers\ApiServiceProvider::class
```

This service provider will register `api` macros for more comfortable work. You will have the following format of call available in `api` format:

```
response()->api($data)
```

In full format it will look as following:

```
new \BwtTeam\LaravelAPI\Response\ApiResponse($data)
```

Also, this service provider will allow to publish config file in order to update package settings according to your needs. Use the following command for publication:

```
php artisan vendor:publish --provider="BwtTeam\LaravelAPI\Providers\ApiServiceProvider" --tag=config
```

To make all responses (including alerts etc) be sent in the same format, change class parent to `\BwtTeam\LaravelAPI\Exceptions\Handler` in `App\Exceptions\Handler` class

```
class Handler extends \BwtTeam\LaravelAPI\Exceptions\Handler
```

And middleware `\BwtTeam\LaravelAPI\Middleware\Api` should be connected to specific path (or the whole app) to make this path be handled as API method.

If you are using `App\Http\Requests` class instances for validation, you need to inherit from `BwtTeam\LaravelAPI\Requests\ApiRequest`, rather than `Illuminate\Foundation\Http\FormRequest`.

### Setup in Lumen

[](#setup-in-lumen)

After composer update register a service provider, by adding the following lines into `bootstrap/app.php`:

```
$app->register(\BwtTeam\LaravelAPI\Providers\ApiServiceProvider::class);
```

Copy config file `vendor/bwt-team/laravel-api/config/api.php` into config directory, which is stored in root directory (or create it yourself if it is missing) and set it up according to your needs. To load settings from this file in `bootstrap/app.php`add the following lines:

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

To make all responses (including alerts etc) be sent in the same format, change class parent to BwtTeam\\LaravelAPI\\Exceptions\\LumenHandler in App\\Exceptions\\Handler

```
class Handler extends \BwtTeam\LaravelAPI\Exceptions\LumenHandler
```

And middleware `\BwtTeam\LaravelAPI\Middleware\Api` should be connected to specific path (or the whole app) to make this path be handled as API method.

### License

[](#license)

This package is using [MIT](LICENSE.md).

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity75

Established project with proven stability

 Bus Factor1

Top contributor holds 57.1% 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 ~192 days

Recently: every ~274 days

Total

12

Last Release

1281d ago

PHP version history (5 changes)v1.0.0PHP &gt;=5.5.9

v1.1.0PHP ^7.1.3

v1.1.6PHP &gt;=7.0

v1.1.7PHP &gt;=7.3

v1.1.8PHP ^8.0.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/d8706e19b2613bd9a54b4e7bab80e6e3f719ea68002db68ebaba6e1eaf93d1e0?d=identicon)[BWT group](/maintainers/BWT%20group)

---

Top Contributors

[![ihor-radchenko](https://avatars.githubusercontent.com/u/30658582?v=4)](https://github.com/ihor-radchenko "ihor-radchenko (4 commits)")[![poberezhnyi-pavlo](https://avatars.githubusercontent.com/u/83660435?v=4)](https://github.com/poberezhnyi-pavlo "poberezhnyi-pavlo (2 commits)")[![mikijunior](https://avatars.githubusercontent.com/u/48656152?v=4)](https://github.com/mikijunior "mikijunior (1 commits)")

---

Tags

apilaravellumen

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/bwt-team-laravel-api/health.svg)

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

###  Alternatives

[mollie/laravel-mollie

Mollie API client wrapper for Laravel &amp; Mollie Connect provider for Laravel Socialite

3624.1M28](/packages/mollie-laravel-mollie)[essa/api-tool-kit

set of tools to build an api with laravel

52680.5k](/packages/essa-api-tool-kit)[resend/resend-laravel

Resend for Laravel

1191.4M6](/packages/resend-resend-laravel)[dragon-code/laravel-json-response

Automatically always return a response in JSON format

1118.6k1](/packages/dragon-code-laravel-json-response)

PHPackages © 2026

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