• Forum Registration System Currently Closed, It Will Open Again Next Month.

Laraveldaily - How to Structure Laravel Project

Laraveldaily - How to Structure Laravel Project

Register & Get access to index
FbDP2z1.png

Where to put your logic?



The most often question I hear in Laravel is this:

“Where should I put this code logic?”

Here’s a typical post from StackOverflow:

Screen-Shot-2019-01-03-at-10.04.55-AM-1024x484.png

Basic Laravel is an MVC framework, it’s clear what should be in Model, View and Controller. But what if you have custom logic for processing data before passing it to the view? Where should it be?

  • In the same Controller method?
  • Separate private Controller method?
  • Static function in Model?
  • Separate class, like Service?
  • Or, maybe, global helper function without any class?
  • Also, I’ve heard Repository is a widely-used pattern?
And the list goes on.

Of course, the correct answer is it depends. But depends on what?
This is what I’m gonna talk about in this course.

The goal is to discuss practical examples of structuring larger Laravel applications, various approaches and patterns. We will analyze existing popular open-source projects and their structure.
Author
TUTProfessor
Downloads
97
Views
818
First release
Last update
Rating
0.00 star(s) 0 ratings

More resources from TUTProfessor