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

java - How to specify maven bin in eclipse maven plugin? -

Error while updating a record in APEX screen -

c++ - In an add-in in Excel, written in C(++), how does one get the name of the function which called into the addin? -