0

Currently I have a Laravel 4 app that uses Laravel for authentication and persistence and an API and have a coupled AngularJS frontend for the staff to utilize but since I need to expand this, I figure I will upgrade to Laravel 5 at the same time.

How would you suggest I proceed architecturally to achieve the following:

[1] The admin "CMS" would be accessible to a very small select group of users and would be ALL Laravel and do basic CRUD operations. I'd like it to be at http://admin.domain.com (access: small subset of "staff" users)

[2] An API protected with JWT for the consumer application at http://www.domain.com/api/ (access: authenticated users of staff and client types)

[3] The staff portal - an Angular front-end via the API at http://staff.domain.com (access: all "staff" users)

[4] The client portal - an Ionic/Angular front-end via the API for public consumption at http://www.domain.com. (access: all "staff" users and registered "client" users.

Any advice is greatly appreciated.

3
  • Could you be more specific? Is your question how to create de different subdomains? Because if it's that, it can easily be achieved using routes. Commented Feb 17, 2015 at 18:46
  • I apologize for the vagueness of the question but I am just lost as how to accomplish something like this and don't know where else to turn for such a new framework. Given that, where I am "most lost" is how can I offer multiple login opportunities and also how do different subdomains "share" a single application? I thought of using symbolic links in Apache so that the subdomains can share a single app but how would I parcel out the index.php to address the different situations? Commented Feb 17, 2015 at 18:49
  • See if what you needed was answered below, I think that is what you needed. If not place a comment and I will try to add it to the answer. Commented Feb 17, 2015 at 19:04

1 Answer 1

1

Based in what you commented here is how you can achieve the multiple domain arquitecture:

Route::group(array('prefix'=>'subdomain'),function(){ //Here you will add your routes that should be used within subdomain.yourdomain.com }); 

For the login part you can basically create each user under a different groups/level and basically use the routes filter again to build your app perms. Something like this:

Route::group(array('namespace' => 'Admin'), function() { //Add here your routes that should work only for admin }); 

See http://laravel.com/docs/4.2/routing#route-groups for more information about routing.

Also if you want a more elegant solution for the permissions you could use some packages like Entrust or Verify

EDIT: If you want to go the routing way, you could use this tutorial as a good reference.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.