multiple route file instead of one main route file in laravel 5

前端 未结 9 1110
广开言路
广开言路 2020-12-15 12:58

I am a novice in web developing with Laravel 5. I installed asGgardCMS and After seeing asgardCms codes, I found that there is nothing codes in app/Http/route.php file and r

9条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-15 13:18

    The group() method on Laravel's Route, can accept filename, so we can something like this:

    // web.php
    
    Route::prefix('admin')
        ->group(base_path('routes/admin.php'));
    
    // admin.php
    Route::get('/', 'AdminController@index');
    

提交回复
热议问题