2

I have only one routes app/routes.php, I am using git /git-hub for sharing my projects with some developers. Cause they can work together. But problem is that : every one using same routes.php file for routing and when they push/pull in git this routes.php file conflicts all the time.

Is there any way to set routes for different developer in same project ?

John Saunders
  • 160,644
  • 26
  • 247
  • 397

3 Answers3

2

This is what Github is all about - collaboration between multiple developers.

There are many ways to handle this - but in general each developer can fork his own branch - make changes - then merge them back in.

You will expect conflicts on the file - but the conflicts should not be the same route - it should be different routes in the same file - so you can merge the conflict into the one route file

Laurence
  • 58,936
  • 21
  • 171
  • 212
  • Thanks for your reply. Is there any example/resources that I can go through on them ? Please –  Dec 17 '14 at 09:53
  • http://stackoverflow.com/questions/8508861/two-people-working-on-a-file-at-the-same-time-in-git – Laurence Dec 17 '14 at 09:57
  • Or this: http://stackoverflow.com/questions/4028845/how-two-people-concurrently-editing-the-same-file-is-handled – Laurence Dec 17 '14 at 09:58
1

There is a silly way but fruitful::

  1. create routes_demo.php :: here demo developer can work
  2. Include routes_demo.php in your main routes.php

include more as your need. Enjoy sharing codes /projects.

THanks

Selim Reza
  • 372
  • 8
  • 20
0

I suggest you use controllers to define routing logic, so your routes.php file does not get complicated. You will avoid a lot of conflicts this way. You can read more here. Pasting an excerpt:

Instead of defining all of your route-level logic in a single routes.php file, you may wish to organize this behavior using Controller classes. Controllers can group related route logic into a class, as well as take advantage of more advanced framework features such as automatic dependency injection.

kroky
  • 1,266
  • 11
  • 19
  • But we are using routes for Controller. When we push or pull it conflicts –  Dec 17 '14 at 10:15