configureRateLimiting(); $this->routes(function () { Route::prefix('api/v1') ->middleware(['api', 'locale']) ->namespace($this->namespace) ->group(base_path('routes/api.php')); Route::middleware(['web', 'locale']) ->namespace($this->namespace) ->group(base_path('routes/web.php')); Route::prefix('api') ->namespace($this->namespace) ->middleware('throttle:third-party') ->group(base_path('routes/third-party.php')); Route::prefix('admin') ->namespace($this->namespace) ->middleware([Filament::class]) ->group(base_path('routes/admin.php')); }); } /** * Configure the rate limiters for the application. * * @return void */ protected function configureRateLimiting() { RateLimiter::for('api', function (Request $request) { return Limit::perMinute(60)->by(optional($request->user())->id ?: $request->ip()); }); RateLimiter::for('third-party', function (Request $request) { return Limit::perMinute(10)->by(getip()); }); } }