Skip to main content

How to Structure Laravel Project

4h 51m 17s
English
Paid

Course description

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?

Read more about the course
  • 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.

Important notice: this course won’t be about design patterns. So fancy keywords like Singleton, Factory, Adapter, Repository etc will be used only when appropriate.
What I will try to do is focus on the practical side: folders, classes and methods, and not on how that pattern actually is called in theory. In reality, every project is actually a mix of patterns, and developers don’t even know how they’re called.

Watch Online

This is a demo lesson (10:00 remaining)

You can watch up to 10 minutes for free. Subscribe to unlock all 29 lessons in this course and access 10,000+ hours of premium content across all courses.

View Pricing
0:00
/
#1: Use More Eloquent: Accessors/Mutators, Scopes, Observers & "Magic" Methods

All Course Lessons (29)

#Lesson TitleDurationAccess
1
Use More Eloquent: Accessors/Mutators, Scopes, Observers & "Magic" Methods Demo
10:10
2
Controllers and Routes: Where to Put "Extra" Methods?
08:54
3
Structuring Blade Files: @extends, @yield and Other Commands
13:18
4
Custom Base Controllers and Base Models
05:14
5
Configuration: Never Use env() Directly in Controllers/Models
05:27
6
Form Request Classes for Validation
04:36
7
User Notifications: Stop Using Mail::send()
05:51
8
Jobs, Queues and Scheduling Tasks
05:05
9
Events and Their Listeners
07:16
10
API Resources for Data Transformation
09:18
11
Global Helpers, External PHP Classes, Autoloading and PSR-4
06:53
12
1. Single-Responsibility Principle
06:36
13
2. Open-Closed Principle
11:37
14
3. Liskov Substitution Principle
04:23
15
4. Interface Segregation Principle
05:18
16
5. Dependency Inversion Principle
04:44
17
Repositories: to Use or Not to Use?
09:12
18
When/How to Use Service Classes?
06:36
19
Traits: Good Practice or Last Resort?
04:51
20
Dependency injection in PHP and Laravel
06:31
21
Adapter, Strategy, Factory and Other Fancy Words
05:29
22
Wait, What About Unit Testing?
05:35
23
Create Your Own Laravel Package
09:20
24
Laravel Modules: Package by Nicholas Widart
07:03
25
Review: Akaunting Open-Source Project Structure
40:51
26
Review: Laravel.io Community Portal Structure
12:03
27
Review: MonicaHQ - Personal CRM Project Structure
41:55
28
Public Website + Adminpanel: Reusing Classes and Features
12:16
29
Refactoring Big Controller Into Various Classes/Methods
14:55

Unlock unlimited learning

Get instant access to all 28 lessons in this course, plus thousands of other premium courses. One subscription, unlimited knowledge.

Learn more about subscription

Comments

0 comments

Want to join the conversation?

Sign in to comment

Similar courses

Test-Driven Laravel

Test-Driven Laravel

Sources: adamwathan
The biggest objective of this course is to teach you how to TDD something real; not just another cookie-cutter to-do app.
21 hours 48 minutes 56 seconds
Develop and Deploy Laravel Applications with Docker

Develop and Deploy Laravel Applications with Docker

Sources: Andrew Schmelyun
Learn how to use the power of Docker to develop, test, and deploy Laravel applications in local and production environments with this premium video course.
2 hours 29 minutes 56 seconds
Master Laravel, Vue 3 & Inertia Full Stack 2023

Master Laravel, Vue 3 & Inertia Full Stack 2023

Sources: udemy
Learn Laravel together with Vue.js in this brand new, full-stack, project based course! Learn how to create a robust API in Laravel and a Single Page Application frontend in Vue...
35 hours 53 minutes 40 seconds
DevOps Project: CICD with Git GitLab Jenkins and Laravel

DevOps Project: CICD with Git GitLab Jenkins and Laravel

Sources: udemy
Continuous Integration Continuous Delivery/Deployment (CICD) is a very important part of modern-day software release processes. As a matter of fact, you can not survive as a Dev...
4 hours 47 minutes 21 seconds
RESTful API with Laravel: Build a real API with Laravel

RESTful API with Laravel: Build a real API with Laravel

Sources: udemy
Build your RESTful API with Laravel, using a complete marketplace as the case of use. With Laravel, creating every component will be a breeze. You will have a p
14 hours 30 minutes 19 seconds