Support the ongoing development of Laravel.io →
Configuration Architecture
Last updated 1 year ago.
0

Why do you need to separate them?

Last updated 1 year ago.
0

Because there are going to be a ton of files, classes, etc. Jumbling them all up into the same folders doesn't seem like a good idea to me. It seems that it would increasingly slow down development time the further I get. Not saying it's not an option, but my initial gut reaction is that it's not a good idea.

One example of a problem that might arise is authorization. What if the CMS has an AuthController that authorizes registration/login for Administrators, and the front-facing site has a login/registration as well, but uses a different database table (or different anything). Now the AuthController just got a lot more complex, and I'd rather just have a different controller for that particular authorization.

Now, in the above case I could just create an AdminAuthController in the same folder. Boom. Problem solved. But isn't it easier to have all admin controllers in a separate folder? This way when I'm working on the CMS I can just go in that folder and see everything that I'm working with, instead of being confused by the multitudes of controllers that may or may not be CMS ones.

Last updated 1 year ago.
0

Seems like you're over thinking this a little bit. How about just a simple key based permissions system where you can give users, say, the 'admin.panel' permission then have a PermissionFilter?

Last updated 1 year ago.
0

I'm developing something similar for my senior project and I was wondering how to go about that. I think I'm going to go with Connor's suggestion but I'm still pretty new to this so if you can elaborate a little more that would be super helpful.

Last updated 1 year ago.
0

ConnorVG said:

Seems like you're over thinking this a little bit. How about just a simple key based permissions system where you can give users, say, the 'admin.panel' permission then have a PermissionFilter?

You're probably right, but I'm not doing this for permissions specifically. That's not big deal. I'm just thinking about how to separate like files in general so the project doesn't get overwhelmingly cluttered later on, once I add in command handlers and repositories and all this stuff and I want to know exactly what stuff is for Admin (CMS) vs Front End.

Someone suggested making the Admin part a package, but I don't really see how I could integrate views into that...(I'm a noob though so it may be pretty easy)

Last updated 1 year ago.
0

I'd suggest organizing things buy what they do, and not by who does them. Usually there is a lot of overlapping functionality. A user editing their profile isn't much different than an admin editing that same profile.

Last updated 1 year ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.