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

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

    in case someone still after that

    https://ctf0.wordpress.com/2016/10/01/split-routes-into-categories-in-laravel/

    1- open routes/web/api.php and add

    foreach (File::allFiles(__DIR__ . '/Routes') as $route_file) {
      require $route_file->getPathname();
    }
    

    2- now create a new folder at the same level and call it ‘Routes‘

    3- create files according to each route ex.user, post, stuff, etc… and add ur route logic as normal

提交回复
热议问题