gameoverllc
4 months ago

Where to put logic in laravel?

Posted 4 months ago by gameoverllc

Hi,

I've been reading a lot on Stackoverflow and seen a lot of tutorials on here and Youtube, but I see conflicting advice on where to keep business logic. (i.e. data manipulation, data imports). Some of these would be tied to a route, and others would be scheduled jobs.

I see some people keep this in the model, others more in the controller. I assume to keep any logic in routes i bad as they are for .. routing.

Someone mentioned services, but wouldn't that be another layer on top of the model?

My background is mainly in Python and Flask, so still learning the ropes of Laravel.

Thanks in advance.

Please sign in or create an account to participate in this conversation.