I am creating an application in laravel 5.2.
I have used route:resource like this in my routes.php
Route::resource('users', 'UsersController');
now this is how it looks like in the url http://project.app:8000/users/ryan
I am trying to remove the users
from the url to look something like this http://project.app:8000/ryan
Is there an easy way to do this and still works the same way it did before? Please somebody help, Thanks!
Try Following route:
Route::get('/{name?}', array('as' => 'profile', 'uses' => 'UsersController@profile'));
The optional parameter works for you.
I'm using same in my web http://example.com/samrow
Put this route after all routs :)