Package Data | |
---|---|
Maintainer Username: | Milano |
Maintainer Contact: | contact@lynh.me (Linh Tran) |
Package Create Date: | 2016-11-24 |
Package Last Update: | 2021-02-20 |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2025-01-25 15:08:07 |
Package Statistics | |
---|---|
Total Downloads: | 934 |
Monthly Downloads: | 0 |
Daily Downloads: | 0 |
Total Stars: | 2 |
Total Watchers: | 2 |
Total Forks: | 0 |
Total Open Issues: | 0 |
Require this package with composer:
composer require jenky/laravel-api
Copy the package config to your local config with the publish command:
php artisan vendor:publish
or
php artisan vendor:publish --provider="Jenky\LaravelAPI\ApiServiceProvider"
Please remove the api
prefix in the mapApiRoutes
method from App\Provivers\RouteServiceProvider
.
/**
* Define the "api" routes for the application.
*
* These routes are typically stateless.
*
* @return void
*/
protected function mapApiRoutes()
{
Route::middleware('api')
// ->prefix('api') Remove or comment this line.
->namespace($this->namespace)
->group(base_path('routes/api.php'));
}
Route::api($version, array $options, $callback)
The $options
parameter can be omitted from the method.
Route::api('v1', [
'as' => 'api.v1.',
'namespace' => 'API\v1',
], function () {
// Your routes go here.
});