laravel新增路由文件配置
app\Providers\RouteServiceProvider.php 文件内
1 protected function mapAppRoutes() 2 { 3 $file = scandir(base_path('routes/app')); 4 foreach ($file as $val) { 5 if (strstr($val,'.php')) { 6 Route::namespace($this->namespace) 7 ->group(base_path('routes/app/'.$val)); 8 } 9 } 10 11 }
public function map() { $this->mapApiRoutes(); $this->mapWebRoutes(); $this->mapAppRoutes(); // }