Laravel BasicsCore· 35 min read

What is Laravel? (MVC)

A framework that gives you everything — routing, database, templates, auth — in an elegant, organised structure called MVC.

What you will learn

  • Explain what a framework is
  • Understand the MVC pattern
  • See why Laravel speeds you up

A framework gives you structure

Laravel is the most popular PHP framework — a ready-made structure and toolkit so you do not build everything from scratch. The raw PHP you learned (forms, sessions, PDO, OOP) is all here, but organised and far easier.

MVC — how Laravel organises code

PartJobExample
ModelThe data (talks to the database)User model
ViewThe HTML the user seesA Blade template
ControllerThe logic connecting themUserController

The flow: a request hits a route → the route calls a controller → the controller uses a model to get data → it passes data to a view → the view’s HTML is sent back.

Here is that same request-to-response journey spelled out step by step, so you can see how the three MVC parts hand work to each other:

  1. The browser sends a request (for example, the user visits /products).
  2. Laravel looks in your routes file and finds the route that matches that URL.
  3. The route hands control to a controller method — the place your logic lives.
  4. The controller asks a model for the data it needs (for example, all products from the database).
  5. The controller passes that data into a view (a Blade template).
  6. The view fills the data into HTML, and Laravel sends that finished HTML page back to the browser.

Tip: Everything you did manually in raw PHP, Laravel does elegantly: routing, database queries (Eloquent), templates (Blade), forms, validation, login. You will appreciate every shortcut because you know what is underneath.

Q. In MVC, which part handles the data and talks to the database?

Answer: The Model represents data and interacts with the database. Views render HTML; Controllers hold the logic linking them.

✍️ Practice

  1. Draw the MVC request flow for “show a list of products”.
  2. Match Model/View/Controller to what each does.

🏠 Homework

  1. Explain MVC in your own words with a real-world analogy.
Want to learn this with a mentor?

CodingClave runs guided, project-based training (28-day, 45-day & 6-month batches).

Explore Training →