Tips to Learn Laravel — What is MVC?

Ming Gao
Nov 18, 2020

--

I hope this will help you to understand laravel basics before diving into tutorials. These are the basics you should know to learn Laravel.

Laravel is a PHP framework based on MVC pattern and this design pattern is being used in modern web frameworks like Python/Django and Ruby On Rails.

What is MVC? It’s Model-View-Controller. This is MVC design of Laravel Framework.

Laravel MVC Artichecture

I assume that you know what Request and Response are. If you don’t know what it is, please read my previous article.
https://gold2ragon.medium.com/for-absolute-web-beginners-871621468080

To make you understand easily, let’s assume that a Laravel website is a hospital. You’re a patient.

You visited the hospital. (You visited the website.)
First you will go to a Reception. (This is Routing.) He will hear basic requests from you and send you to an appropriate Department. (This is Controller.)
The department or a doctor(Controller) will listen to you details (Analyze Request in detail). If they already have experience in your disease they will give you a Recipe (View). Or they might have do research Data for your disease (Model). After they find it they will give you a Recipe.

Let me explain in Laravel again. If a user sends a request, Route handles the request and sends it to a controller which can manage the request. The controller which received the request from routing gets details from the request and sends a view as a response. Before sending a view it may work with the database.

I will explain other needed concepts in next blogs.

--

--