Split Routes Into Categories In Laravel (*)

- this is orignally made by Jeffrey Way so all credits goes to him.

1- open routes.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

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s