📜  laravel 同路由不同组 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:53:49.274000             🧑  作者: Mango

代码示例2
$myroutes =  function () {
    Route::get('/news', 'NewsController@index')->name('news_index');
    Route::get('/article', 'ArticleController@index')->name('article_index');
};

Route::group(['prefix' => 'chemistry'], $myroutes);
Route::group(['prefix' => 'math'], $myroutes);
Route::group(['prefix' => 'geography'], $myroutes);