php - laravel setup different route according to domain/subdomain -


good day,

i using laravel build both website , apis mobile backend, api controller setup this:

route::controller("api/", "apicontroller"); //mobile apis, response in json 

and other routes , this:

route::controller("/", "maincontroller"); 

i need setup subdomain apis, instance:

http://api.mysite.com

to route directly api controller, need because don't want url long , ugly. suggestions ?

try using this

route::group(array('domain' => 'api.mysite.com'), 'apicontroller'); 

Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -