You can route incoming requests directly to your existing Controller
s using the Route::controller()
method in routes.php
:
Route::controller('home', 'HomeController');
Route::controller('appointments', 'AppointmentsController');
Then all requests to home/*
will go be handled by your HomeController
, appointments/*
will go to AppointmentsController
etc etc etc.
It looks you have already created your functions in the Controller using the HTTP method, so then:
a HTTP GET
to '/'
will be handled by HomeController@getIndex()
a HTTP GET
to 'logout'
will be handled by HomeController@getLogout()
a HTTP POST
to 'login'
will be handled by HomeController@postLogin()
More in the excellent and eloquent Laravel docs here