bwt-team/laravel-api
Larablocks Analysis
bwt-team/laravel-api works with Laravel 9 (latest release v1.1.8, Nov 15, 2022), which reached end of life on Feb 6, 2024: no more fixes, even for security.
Laravel 5 to 8 in earlier releases.
Recommendation checks
Not advisedNot advised: no release or commit in over 2 years.
- No release or commit in over 2 years
- Supports only Laravel 9, past end of life since Feb 6, 2024
- No release in the last 12 months (last: Nov 15, 2022)
- 207 downloads a month (needs 10,000)
- 1 GitHub star (needs 100)
State
Likely abandoned- No release or commit in over 2 years.
- Last stable release: Nov 15, 2022.
- No releases in the last 12 months.
- First released: Jan 28, 2017.
- Monthly downloads: 207, up 209% from six months ago.
- 0 open issues on GitHub.
Data from Packagist and GitHub, checked by Larablocks on Nov 26, 2026.
| Install | |
|---|---|
composer require bwt-team/laravel-api |
|
| Latest Version: | v1.1.8 |
| PHP: | ^8.0.2 |
| Laravel: | 9 |
| Older releases: | 5 – 8 |
| License: | MIT |
| Last Updated: | Nov 19, 2022 |
| Links: | GitHub · Packagist |
English description | Russian description
Laravel 5 API
This package allows to easily and quickly setup basics for API.
Content
Installation
Install this package with composer using the following command:
composer require bwt-team/laravel-api
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
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.phpadd 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
This package is using MIT.
Related Packages
Missing form requests functionality for lumen, ported from laravel framework.
A query parser for REST-APIs based on laravel's lumen framework
Missing form requests functionality for lumen, ported from laravel framework.
Version History
| Version | Released | PHP | Laravel | License |
|---|---|---|---|---|
| v1.1.8 | ^8.0.2 | ^9.0 | MIT | |
| v1.1.7 | >=7.3 | ^8.0 | MIT | |
| v1.1.6 | >=7.0 | ^7.0 | MIT | |
| v1.1.5 | >=5.5.9 | ^7.0 | MIT | |
| v1.1.4 | >=5.5.9 | ^6.0 | MIT | |
| v1.1.3 | >=5.5.9 | ^5.0 | MIT | |
| v1.1.2 | >=5.5.9 | ^5.0 | MIT | |
| v1.1.1 | >=5.5.9 | ^5.0 | MIT | |
| v1.1.0 | ^7.1.3 | ^5.0 | MIT | |
| v1.0.2 | >=5.5.9 | ^5.0 | MIT | |
| v1.0.1 | >=5.5.9 | ^5.0 | MIT | |
| v1.0.0 | >=5.5.9 | ^5.0 | MIT |