Update RouteServiceProvider.php

This commit is contained in:
Ralph J. Smit
2022-07-01 12:01:33 +02:00
parent 34b838c259
commit ec45b0dac0

View File

@@ -31,13 +31,14 @@ class RouteServiceProvider extends ServiceProvider
*
* @return void
*/
public function boot()
public function boot(): void
{
$this->configureRateLimiting();
$this->routes(function () {
// The settings('enable_api') is now handled by the GlobalApiAuthenticated middleware,
// because the conditional inside this service makes testing very hard.
// because the conditional inside this service makes testing very hard. This doesn't
// matter for existing users, because now the middleware will return 404 responses.
Route::prefix('api')
->middleware(['api', 'global.api.authenticated'])
->namespace($this->namespace . '\Api')
@@ -61,7 +62,7 @@ class RouteServiceProvider extends ServiceProvider
*
* @return void
*/
protected function configureRateLimiting()
protected function configureRateLimiting(): void
{
RateLimiter::for('api', function (Request $request) {
return Limit::perMinute(60);