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

前端 未结 9 1124
广开言路
广开言路 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:03

    You can use Request::is() so your main routes.php file will look like this:

    if(Request::is('frontend/*))
    {
        require __DIR__.'/frontend_routes.php;
    }
    
    if(Request::is('admin/*))
    {
        require __DIR__.'/admin_routes.php;
    }
    

    You can read more here.

提交回复
热议问题