I am building a social networking application using Laravel 5, and I am slightly confused about the structure of the URLs.
Using a previous Stack Overflow post from another member, I have managed to grasp the basics (profiling, account, etc). Here is what I have so far:
http://myapp.com/account/create
http://myapp.com/account/login
http://myapp.com/account/logout
http://myapp.com/account/verify
http://myapp.com/account/verify/{token}
http://myapp.com/account/settings
http://myapp.com/profile/FooMan
And that's all well and good (at least I think so - any tips are welcome), but how do I go about creating a URL structure for things such as friends? I get that you could have:
http://myapp.com/profile/FooMan/friends
But to me, that seems ugly. And if I wanted to add a "/add" route to the friends, how would I go about that also? Thank you in advance!
P.S. On some of the pages, such as "login" and "create" I use the route::get() to display the form, and route::post() to submit the details to the controller. Is this bad practice?
profile/my-friends?profile/FooMan2/add?domain.com/fooman2for someone elses profile, anddomain.com/friendsfor current users connections. This is pretty standard just navigate around twitter and facebook.friends, create, unfollowetc much like reserved words in a programming language. I am sure twitter doesn't allow you to signup with the account namefollowers. You will only have at most 10 or 20 root route actions so its not hard to add to your validation