From the course: Laravel 9.0 Essential Training

Understand the MVC architecture

From the course: Laravel 9.0 Essential Training

Start my 1-month free trial

Understand the MVC architecture

- [Instructor] Lateral framework is largely based on the MVC architecture. MVC is a way of building a huge application by splitting it into three parts, models, views, and controllers. This makes maintaining the application easy as it grows and avoids repetition of code, along with a few other benefits. The model contains all the logic related to the application's data, like the schemas, the databases, and their fields. This is the part where you write the code to interact with the database. The view contains the user interface. All the components that the user sees on the webpage and interacts with are included in the views. The controller is what connects the model and the view. It handles all the interactions between these two components. So in simpler words, the user interacts with the webpage, which is the view. The controller takes the user's input from the view, uses some logic to translate that input into a request for the model. The model then grabs the data from the database, and the controller passes this data from the model back to the view for the user to see. Once you have this basic concept in mind, during the course, you will better understand why a specific block of code is added in a particular file and not elsewhere. Now let's go ahead and set up our development environment.

Contents