Published configuration files reside in config/streams/
.
├── config/streams/
│ └── api.php
Use the following command to publish configuration files.
php artisan vendor:publish --provider=Streams\\Api\\ApiServiceProvider --tag=config
The above command will copy configuration files from their package location to the directory mentioned above so that you can modify them directly and commit them to your version control system.
Below are the contents of the published configuration file:
// config/streams/api.php
return [
/*
* Determine if the API should be enabled.
*
* This is disabled by default because
* The API is public by default.
*/
'enabled' => env('STREAMS_API_ENABLED', false),
/*
* Specify the API prefix.
*/
'prefix' => env('STREAMS_API_PREFIX', 'api'),
/*
* Specify the API group middleware.
*
* This is designed to match out of the box
* "app/Providers/RouteServiceProvider.php"
* and "app/Http/Kernel.php" Laravel files.
*
* Changing this value will require
* adjusting the above files.
*/
'middleware' => env('STREAMS_API_MIDDLEWARE', 'api'),
];
API middleware an be configured in your application's HTTP kernel.
// app/Http/Kernel.php
protected $middlewareGroups = [
'api' => [
'throttle:60,1',
'bindings',
\Streams\Api\Http\Middleware\ApiCache::class,
],
];
The app/Providers/RouteServiceProvider.php
file typically uses the api
middleware group when loading the routes/api.php
file. By default this is compatible and routes defined there will be properly prefixed and grouped.
A blank TALL-stack Laravel project with Streams.
The fundamental features and utilities offered by the Streams platform.
A universal and extensible RESTful API for Streams.
Extensible, user-friendly, and performant control panel, components, and services.
Dev tooling for Laravel Streams.