wrap middleware in api
group in app/Http/Kernel.php
'api' => [
'throttle:60,1',
\App\Http\Middleware\WebserviceLogger::class,
],
Your routes should be wrapped in app/Http/routes.php
like this:
Route::group(['middleware' => ['api'], 'prefix' => 'api'], function () {
Route::post('register', 'ApiController@register');
Route::post('login', 'ApiController@login');
});
Note: You can use
LOG_WEBSERVICE
as a boolean in.env
in order to log under specified environment.