1

For example:

abc.com
There's a registration/login authentication build in Codeigniter using REST API

somename.bm
Again there's a registration/login authentication build in Laravel using same ^ REST API

Both these domains uses same concept of authentication of the user and even after login, most of the pages are same (expect for the data we choose to display and css).

Now my simple question is, is there any way where I can have a common code where both these websites access the same controller and somehow I differentiate the call and then simply call the REST API to access the data and display accordingly.

Again, if I miss something or need further elaboration, feel free to contact me here.

Digvijay
  • 7,836
  • 3
  • 32
  • 53
  • 1
    You can have the same controller and model for each website but change the view folder called in config/view.php . – Roadirsh Nov 17 '16 at 16:25
  • Thanks I appreciate the feedback, I will try it out. I also came across this page, what do you think? http://stackoverflow.com/questions/26349978/laravel-host-setup-for-multi-tld – Digvijay Nov 17 '16 at 16:33
  • The answer from Jimmy in the other thread can work but you will have to duplicate every route. – Roadirsh Nov 17 '16 at 16:46
  • @Roadirsh - I will still need to have an installation of Laravel per domain? So how can I "have the same controller and model for each website but change the view folder called in config/view.php"? From other threads I understand that I have to make some changes in routes.php as well (if needed) but If I have installation of Laravel at 2 different places... How will the code take affect? Again, I apologize for asking basic questions. (just started working on this project few days back) – Digvijay Nov 17 '16 at 17:29
  • 2
    no, you will have one folder on an apache server like any other domain. But for the second tld you will have to point to the same server and in your view.php you will have to make a condition based on the tld to check which view folder you should use. – Roadirsh Nov 17 '16 at 17:34

0 Answers0