Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Jaytee's avatar
Level 39

A Few questions about Laravel and structuring application

Hey guys,

I have a few questions to ask you:

I'm building a website where users can compete in events for free and prizes.

I find myself having difficulty separating all of the logic. For example, so far and that's not even it completed, i have 5 controllers just for the events.

EventController
MatchController
RulesController
SignUpController
TeamController

It feels like too much? What is the best way to approach this?

I'm also looking to integrate stripe/cashier. Any suggestions for directory structures and such? Im also looking to integrate both braintree and stripe so how would i go about allowing users to select their checkout payment choice and build the forms accordingly and stuff?

Also, is it worth having an event_options table for of course, options for an event.

the table structure has an event_id, a name and a value.

The name is something such as: check_in_required and the value is true.

I've done this for future expansion but is it necessary ?

Any helps on how you structure your apps and such would be great. Thanks

0 likes
1 reply
jekinney's avatar

With out knowing your scope completely, I recommend: each controller just stick to restful as much as possible. Sometimes it doesn't make sense too, be if you don't give it a minute to thing about it.

Secondly a controller in mvc by definition is to direct required data for a view or receive request data. A middle layer to direct flow. (Extremely basic).

So having enough controllers to manage this is appropriate. I usually try to set up as modular as I can. So for example the proverbial blog. I set models under app/blog/models. Controllers under app/http/controllers/blog. Views under a blog folder in views. On larger apps I'll use traits to link relationships together. So in a blog I'll set up an user trait under blog namespace and import into the user model. It has all the user/author relationships to any required blog models (article, comments etc).

Braintree and stripe might be overkill as Braintree allows c/c and PayPal.

Please or to participate in this conversation.