RouteServiceProvider.php 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <?php
  2. namespace App\Providers;
  3. use Illuminate\Support\Facades\Route;
  4. use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
  5. class RouteServiceProvider extends ServiceProvider
  6. {
  7. /**
  8. * This namespace is applied to your controller routes.
  9. *
  10. * In addition, it is set as the URL generator's root namespace.
  11. *
  12. * @var string
  13. */
  14. protected $namespace = 'App\Http\Controllers';
  15. /**
  16. * Define your route model bindings, pattern filters, etc.
  17. *
  18. * @return void
  19. */
  20. public function boot()
  21. {
  22. //
  23. parent::boot();
  24. }
  25. /**
  26. * Define the routes for the application.
  27. *
  28. * @return void
  29. */
  30. public function map()
  31. {
  32. $this->mapApiRoutes();
  33. $this->mapWebRoutes();
  34. //
  35. }
  36. /**
  37. * Define the "web" routes for the application.
  38. *
  39. * These routes all receive session state, CSRF protection, etc.
  40. *
  41. * @return void
  42. */
  43. protected function mapWebRoutes()
  44. {
  45. Route::middleware('web')
  46. ->namespace($this->namespace)
  47. ->group(base_path('routes/web.php'));
  48. Route::namespace($this->namespace)
  49. ->group(base_path('routes/plain.php'));
  50. }
  51. /**
  52. * Define the "api" routes for the application.
  53. *
  54. * These routes are typically stateless.
  55. *
  56. * @return void
  57. */
  58. protected function mapApiRoutes()
  59. {
  60. Route::prefix('api')
  61. ->middleware('api')
  62. ->namespace($this->namespace)
  63. ->group(base_path('routes/api.php'));
  64. Route::prefix('apiLocal')
  65. ->middleware('apiLocal')
  66. ->namespace($this->namespace)
  67. ->group(base_path('routes/apiLocal.php'));
  68. Route::prefix('api/thirdPart/flux')
  69. ->middleware('api')
  70. ->namespace('App\Http\Controllers\Api\thirdPart\flux')
  71. ->group(base_path('routes/api/thirdPart/flux.php'));
  72. Route::prefix('api/thirdPart/weight')
  73. ->middleware('api')
  74. ->namespace('App\Http\Controllers\Api\thirdPart\weight')
  75. ->group(base_path('routes/api/thirdPart/weight.php'));
  76. Route::prefix('api/thirdPart/weixin')
  77. ->namespace('App\Http\Controllers\Api\thirdPart\weixin')
  78. ->group(base_path('routes/api/thirdPart/weixin.php'));
  79. Route::prefix('api/thirdPart/haiq')
  80. ->namespace('App\Http\Controllers\api\thirdPart\haiq')
  81. ->group(base_path('routes/api/thirdPart/haiq.php'));
  82. Route::prefix('api/thirdPart/goodscan')
  83. ->namespace('App\Http\Controllers\api\thirdPart\goodscan')
  84. ->group(base_path('routes/api/thirdPart/goodscan.php'));
  85. Route::prefix('api/thirdPart/haochuang')
  86. ->middleware('api')
  87. ->namespace('App\Http\Controllers\Api\thirdPart\haochuang')
  88. ->group(base_path('routes/api/thirdPart/haochuang.php'));
  89. }
  90. }