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();

//
}

 

posted @ 2020-03-20 15:31  骅骝漫轻舞01  阅读(347)  评论(0编辑  收藏  举报