123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112 |
- <?php
- namespace App\Providers;
- use Illuminate\Routing\Router;
- use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
- 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 = 'App\Http\Controllers';
- /**
- * Define your route model bindings, pattern filters, etc.
- *
- * @param \Illuminate\Routing\Router $router
- * @return void
- */
- public function boot()
- {
- parent::boot();
- }
- /**
- * Define the routes for the application.
- *
- * @param \Illuminate\Routing\Router $router
- * @return void
- */
- public function map(Router $router)
- {
- $this->mapOfficialAccountRoutes($router);
- $this->mapWapRoutes($router);
- $this->mapWebRoutes($router);
- $this->mapXchengyuRoutes($router);
- $this->mapKuaiYingYongRoutes($router);
- }
- protected function mapOfficialAccountRoutes(Router $router)
- {
- $router->group([
- 'middleware' => 'web',
- ], function ($router) {
- require app_path('Http/Routes/Wap/OfficialAccountRoutes.php');
- });
- $router->group([
- 'middleware' => 'wap',
- ], function ($router) {
- require app_path('Http/Routes/Wechat/OfficialAccountRoutes.php');
- });
- }
- /**
- * h5路由
- * @param Router $router
- */
- protected function mapWapRoutes(Router $router)
- {
- $router->group([
- 'middleware' => 'wap',
- ], function ($router) {
- require app_path('Http/Routes/Wap/WapRoutes.php');
- });
- }
- //UI界面
- protected function mapWebRoutes(Router $router)
- {
- $router->group([
- 'middleware' => 'web',
- ], function ($router) {
- require app_path('Http/Routes/WapBrower/WebRoutes.php');
- });
- }
- /**
- * 小程序路由
- * @param Router $router
- */
- protected function mapXchengyuRoutes(Router $router){
- $router->group([
- 'middleware' => 'web',
- ], function ($router) {
- require app_path('Http/Routes/Xchengxu/XchengxuRoutes.php');
- });
- }
- /**
- * 快应用
- */
- protected function mapKuaiYingYongRoutes(Router $router)
- {
- $router->group([
- 'middleware' => 'web',
- ], function ($router) {
- require app_path('Http/Routes/KuaiYingYong/KuaiYingYongRoutes.php');
- });
- }
- }
|