123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361 |
- <?php
- namespace App\Providers;
- use Illuminate\Cache\RateLimiting\Limit;
- use Illuminate\Support\Facades\Route;
- use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
- use Illuminate\Http\Request;
- use Illuminate\Support\Facades\RateLimiter;
- class RouteServiceProvider extends ServiceProvider
- {
- /**
- * This namespace is applied to your controller routes.
- *
- * In addition, it is set as the URL generator's root namespace.
- *
- * @var string
- */
- protected $namespace = null;
- /**
- * Define your route model bindings, pattern filters, etc.
- *
- * @return void
- */
- public function boot()
- {
- //
- parent::boot();
- $this->configureRateLimiting();
- }
- /**
- * Define the routes for the application.
- *
- * @return void
- */
- public function map()
- {
- $this->mapApiRoutes();
- $this->mapAdminRoutes();
- $this->mapSellerRoutes();
- $this->mapAffiliateRoutes();
- $this->mapRefundRoutes();
- $this->mapClubPointsRoutes();
- $this->mapOtpRoutes();
- $this->mapOfflinePaymentRoutes();
- $this->mapAfricanPaymentGatewayRoutes();
- $this->mapPaytmRoutes();
- $this->mapPosRoutes();
- $this->mapSellerPackageRoutes();
- $this->mapDeliveryBoyRoutes();
- $this->mapAuctionRoutes();
- $this->mapWholesaleRoutes();
- $this->mapWebRoutes();
- $this->mapSalesmanRoutes();
- // $this->mapInstallRoutes();
- //$this->mapUpdateRoutes();
- }
- /**
- * Define the "b2b" routes for the application.
- *
- * These routes all receive session state, CSRF protection, etc.
- *
- * @return void
- */
- protected function mapWholesaleRoutes()
- {
- Route::middleware('web')
- ->namespace($this->namespace)
- ->group(base_path('routes/wholesale.php'));
- }
- /**
- * Define the "delivery boy" routes for the application.
- *
- * These routes all receive session state, CSRF protection, etc.
- *
- * @return void
- */
- protected function mapDeliveryBoyRoutes()
- {
- Route::middleware('web')
- ->namespace($this->namespace)
- ->group(base_path('routes/delivery_boy.php'));
- }
- /**
- * Define the "auction" routes for the application.
- *
- * These routes all receive session state, CSRF protection, etc.
- *
- * @return void
- */
- protected function mapAuctionRoutes()
- {
- Route::middleware('web')
- ->namespace($this->namespace)
- ->group(base_path('routes/auction.php'));
- }
- /**
- * Define the "seller package" routes for the application.
- *
- * These routes all receive session state, CSRF protection, etc.
- *
- * @return void
- */
- protected function mapSellerPackageRoutes()
- {
- Route::middleware('web')
- ->namespace($this->namespace)
- ->group(base_path('routes/seller_package.php'));
- }
- /**
- * Define the "affiliate" routes for the application.
- *
- * These routes all receive session state, CSRF protection, etc.
- *
- * @return void
- */
- protected function mapAffiliateRoutes()
- {
- Route::middleware('web')
- ->namespace($this->namespace)
- ->group(base_path('routes/affiliate.php'));
- }
- /**
- * Define the "offline payment" routes for the application.
- *
- * These routes all receive session state, CSRF protection, etc.
- *
- * @return void
- */
- protected function mapOfflinePaymentRoutes()
- {
- Route::middleware('web')
- ->namespace($this->namespace)
- ->group(base_path('routes/offline_payment.php'));
- }
- /**
- * Define the "offline payment" routes for the application.
- *
- * These routes all receive session state, CSRF protection, etc.
- *
- * @return void
- */
- protected function mapPaytmRoutes()
- {
- Route::middleware('web')
- ->namespace($this->namespace)
- ->group(base_path('routes/paytm.php'));
- }
- /**
- * Define the "offline payment" routes for the application.
- *
- * These routes all receive session state, CSRF protection, etc.
- *
- * @return void
- */
- protected function mapAfricanPaymentGatewayRoutes()
- {
- Route::middleware('web')
- ->namespace($this->namespace)
- ->group(base_path('routes/african_pg.php'));
- }
- /**
- * Define the "refund" routes for the application.
- *
- * These routes all receive session state, CSRF protection, etc.
- *
- * @return void
- */
- protected function mapRefundRoutes()
- {
- Route::middleware('web')
- ->namespace($this->namespace)
- ->group(base_path('routes/refund_request.php'));
- }
- /**
- * Define the "club points" routes for the application.
- *
- * These routes all receive session state, CSRF protection, etc.
- *
- * @return void
- */
- protected function mapClubPointsRoutes()
- {
- Route::middleware('web')
- ->namespace($this->namespace)
- ->group(base_path('routes/club_points.php'));
- }
- /**
- * Define the "OTP System" routes for the application.
- *
- * These routes all receive session state, CSRF protection, etc.
- *
- * @return void
- */
- protected function mapOtpRoutes()
- {
- Route::middleware('web')
- ->namespace($this->namespace)
- ->group(base_path('routes/otp.php'));
- }
- /**
- * Define the "POS System" routes for the application.
- *
- * These routes all receive session state, CSRF protection, etc.
- *
- * @return void
- */
- protected function mapPosRoutes()
- {
- Route::middleware('web')
- ->namespace($this->namespace)
- ->group(base_path('routes/pos.php'));
- }
- /**
- * Define the "updating" routes for the application.
- *
- * These routes all receive session state, CSRF protection, etc.
- *
- * @return void
- */
- protected function mapUpdateRoutes()
- {
- Route::middleware('web')
- ->namespace($this->namespace)
- ->group(base_path('routes/update.php'));
- }
- /**
- * Define the "installation" routes for the application.
- *
- * These routes all receive session state, CSRF protection, etc.
- *
- * @return void
- */
- protected function mapInstallRoutes()
- {
- Route::middleware('web')
- ->namespace($this->namespace)
- ->group(base_path('routes/install.php'));
- }
- /**
- * 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'));
- }
- /**
- * Define the "admin" routes for the application.
- *
- * These routes all receive session state, CSRF protection, etc.
- *
- * @return void
- */
- protected function mapAdminRoutes()
- {
- Route::middleware('web')
- ->namespace($this->namespace)
- ->group(base_path('routes/admin.php'));
- }
- /**
- * Define the "seller" routes for the application.
- *
- * These routes all receive session state, CSRF protection, etc.
- *
- * @return void
- */
- protected function mapSellerRoutes()
- {
- Route::middleware('web')
- ->namespace($this->namespace)
- ->group(base_path('routes/seller.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'));
- }
- /**
- * Configure the rate limiters for the application.
- *
- * @return void
- */
- protected function configureRateLimiting()
- {
- RateLimiter::for('api', function (Request $request) {
- return Limit::perMinute(600)->by(optional($request->user())->id ?: $request->ip());
- });
- }
- /**
- * Define the "salesman" routes for the application.
- *
- * These routes all receive session state, CSRF protection, etc.
- *
- * @return void
- */
- protected function mapSalesmanRoutes()
- {
- Route::middleware('web')
- ->namespace($this->namespace)
- ->group(base_path('routes/salesman.php'));
- }
- }
|