configureRateLimiting(); } /** * Define the routes for the application. * * @return void */ public function map() { $this->mapApiRoutes(); $this->mapAdminRoutes(); $this->mapSupportTicketRoutes(); $this->mapOtpRoutes(); $this->mapReferralRoutes(); $this->mapWebRoutes(); // $this->mapInstallRoutes(); // $this->mapUpdateRoutes(); } /** * Define the "web" routes for the application. * * These routes all receive session state, CSRF protection, etc. * * @return void */ protected function mapWebRoutes() { Route::middleware('web') ->namespace($this->namespace) ->group(base_path('routes/web.php')); } protected function mapAdminRoutes() { Route::middleware('web') ->namespace($this->namespace) ->group(base_path('routes/admin.php')); } protected function mapSupportTicketRoutes() { Route::middleware('web') ->namespace($this->namespace) ->group(base_path('routes/support_tickets.php')); } protected function mapOtpRoutes() { Route::middleware('web') ->namespace($this->namespace) ->group(base_path('routes/otp.php')); } protected function mapReferralRoutes() { Route::middleware('web') ->namespace($this->namespace) ->group(base_path('routes/referral.php')); } protected function mapInstallRoutes() { Route::middleware('web') ->namespace($this->namespace) ->group(base_path('routes/install.php')); } protected function mapUpdateRoutes() { Route::middleware('web') ->namespace($this->namespace) ->group(base_path('routes/update.php')); } /** * Define the "api" routes for the application. * * These routes are typically stateless. * * @return void */ protected function mapApiRoutes() { Route::prefix('api') ->middleware('api') ->namespace($this->namespace) ->group(base_path('routes/api.php')); } protected function configureRateLimiting() { RateLimiter::for('api', function (Request $request) { return Limit::perMinute(1000)->by(optional($request->user())->id ?: $request->ip()); }); } }