MVC (Model View Controller) is a software design pattern that divides an application into three interconnected components: Model handles business logic and database communication, View displays the user interface visible to users, and Controller manages user interactions and coordinates between Model and View. This pattern is not specific to Laravel but is a universal design principle applicable across programming languages like PHP, Java, and C++. In Laravel, the request flow begins when a user opens a website, triggering the Controller, which then interacts with the Model to fetch or store data and sends the processed information to the View for display.
Approfondir
Prérequis
- Pas de données disponibles.
Prochaines étapes
- Pas de données disponibles.
Approfondir
Laravel 13 Tutorial #5 MVC Explained | Model View ControllerAjouté :
Hi everyone. So before exploring the Laravel file and folder structure, we can go through with the MVC design pattern and MVC will help us to understand how Laravel works internally as well as this is a very important interview question also. Its full form is model view controller and keep in mind MVC is not a feature of Laravel.
This is simply a software design pattern that help us to make reliable and better software application. And MVC design pattern we can use in any programming language. You can use it with the PHP, Java, C++, with any programming languages. All right. You can ask one thing there like how MVC design pattern can help us to make better and reliable software application. I'll give you the answer of this question within a moment.
But first understand what is MVC properly. Right? So see in MVC design pattern we divide our application into three parts. First one is model, second one is view and third one is the controller. And this is the full form of this MVC. All right. So in models actually we write our business lo logic and data communication thing. For example, if you are making any banking application and you are writing uh logic to calculate the EMI or interest that code you can put inside the models. So whenever you are communicating with the database fetching some data from the data or you are storing some data in the database that code also you can write in the models. In view area we basically write the code which directly visible to the user. Not code actually the interface which is visible to the user.
For example uh how our website or application look like color theme phone size whatever visible on the UI. All right that we actually put in the view.
Controller basically do two two things.
First one it's interact with the user.
So whenever you are opening any website so first you are executing the controller code right in MVC design pattern. Second thing uh controller actually communicate between model and view also. So what data we have to store in the uh model and what data we have to display in the view everything is controlled by the controller and that's why we call it controller. All right. So let's understand it with the this uh MVC architecture diagram. So here you can see that so if there is a end user and uh if this is uh just opening any website so first request is directly go to the controller or you can say that if you are just uh looking on the code level you can say that first controller code will be executed and according to the condition according to the page it will check it will directly have to show the view or it need to interact with the model. So if let's say directly we need to show the view then it will just go to the view and display to the user and if that page needs some data from the database then it will request for data then it will get data or apply any logic right any business logic after that it will send this data to the view and that view will be displayed to the user. Now you can say that this seems very complex uh architecture right. So is it uh uh is can we understand it easily? Yes, definitely. See if you want to make MVC design pattern in a very simple way. You just need to do uh two things. First create three files. Then just put your uh HTML or visual code that you want to show in the UI in the view. your database communication you can put in the another file and you can communicate these two files and uh communicate with the user with directly with the controller. So you basically need three files divide your code accordingly like uh in one file you can put the UI code in one file you can uh connect with the database and one file will control everything user request and view and model. So this is a simple MVC and LRA will actually follow this design pattern. So whenever in next part we will uh go through with the file and folder structure you will find there are some file for controller there are some file for view and model. So you can easily understand all of these files after this thing. All right. So I hope you just got everything and if you have still any doubt any question you can ask me in the comment section. This is my pium number for donation and please like this video subscribe your subscribe my channel and share your feedback in comment section. Thanks guys.
Vidéos Similaires
resume fixed instantly 😭 Comment “app”andI’ll sendyou the link #parakeetaipartnership #resumetips
Ritcareer
686 views•2026-05-31
Re: 🗣️📍theprophedu📍2026 GST 103 CLASS (E-EXAM REVISION)
theprophedu
636 views•2026-06-04
WEB TECHNOLOGIES UNIT-2 | Degree 4th sem BCOM Computers web technologies unit-2 full explanation💯✅
LearnwithSahera
1K views•2026-05-29
More tests are always better? How to use AI to identify tests that bring little value
Alliance4Qualification
335 views•2026-05-29
Search Algorithms Explained in 60 Seconds! 🤖💨
samarthtuliofficial
218 views•2026-06-01
Making Minecraft Clone with C++ & Raylib
PecaCSLive
686 views•2026-06-04
People of Game of Thrones using JavaScript DOM
AltCampus
296 views•2026-05-30
Instagram accounts got PWNed
EricParker
13K views•2026-06-03
Tendances
Why Batman Lets The Joker Live 🤨
zackdfilms
9222K views•2026-05-30
They're Complete Trash
penguinz0
558K views•2026-06-04
The Murder of Deputy Caleb Conley
MidwestSafety
810K views•2026-06-04
I Bought FAKE HopeScope Merch (and paid a subscriber to give it a makeover) | Hopeful Hauls
HangWithHopescope
158K views•2026-06-04











