Adds configurable web api connections to your Laravel application.
reedware/laravel-api is a Laravel package for adds configurable web api connections to your laravel application..
It currently has 0 GitHub stars and 500 downloads on Packagist (latest version v1.1.0).
Install it with composer require reedware/laravel-api.
Discover more Laravel packages by reedware
or browse all Laravel packages to compare alternatives.
Last updated
This package adds configurable web api connections to your Laravel application.
Require this package with composer.
composer require reedware/laravel-api
Laravel 5.5+ uses Package Auto-Discovery, so doesn't require you to manually add the service provider or facade. However, should you still need to reference them, here are their class paths:
\Reedware\LaravelApi\ApiServiceProvider::class // Service Provider
\Reedware\LaravelApi\Facade::class // Facade
You can configure your various api endpoints by using the ~/config/api.php configuration file.
'connections' => [
'api-name' => [
'host' => env('API_HOST'),
'username' => env('API_USERNAME'),
'password' => env('API_PASSWORD'),
'options' => [
'json' => true,
'expects_json' => true
]
]
]
You can now connect to your api using Api::connection('api-name'), and subsequently create requests for it:
Api::connection('api-name')->request()->url('my/endpoint')->post([
'my-form-data' => 'with-values'
]);