Laravel 5 Authentication: change the default routes -


i have set laravel installation , have been reading documentation , appears ships authentication system built in. use rather build own ( have done in previous version)

my question change default routes , structure like:

www.example.com/register , www.example.com/login

at moment uses auth folder www.example.com/auth/register , www.example.com/auth/login

i think way cleaner , more user friendly. change forgot password www.example.com/forgot-password

i have tried various examples , new routes etc keep getting not found exception. bugging me keep there alter dont fix not broken.

hopefully can point me in right direction.

by default default auth routes use route::controllers(['auth' => 'auth\authcontroller']), route::controller() method generates routes based upon functions available on controller.

you should able remove line , create own routes them. if @ illuminate/foundation/auth/authenticatesandregistersusers trait can see functions available. map routes functions available on auth controller.

heres couple started

route::get('/register', ['uses' => 'auth\authcontroller@getregister']); route::post('/register', ['uses' => 'auth\authcontroller@postregister']);  route::get('/login', ['uses' => 'auth\authcontroller@getlogin']); route::post('/login', ['uses' => 'auth\authcontroller@postlogin']); 

Comments