Skip to content

Glossary

MVC in Laravel: separating data, presentation and flow

An ordering principle that keeps data access, presentation and flow control apart.

MVC stands for model, view and controller. Behind it sits a plain idea: whoever manages data, whoever displays it and whoever steers the flow should not be the same place.

The model looks after data and the rules that apply to it. The view is the presentation. The controller takes a call and brings the two together. Laravel is built along this division, and anyone opening the folders of an application recognises it immediately.

Why it counts day to day

The benefit shows up during changes. When a form should look different, it is clear where to look. When a calculation is wrong, likewise. Without that separation every change becomes a search, and every search a risk of forgetting something in three places.

A common misunderstanding is that the model is the same thing as a database table. It is the place for the business, and that is rarely identical with the table structure. Where that line runs is one of the decisions to be made at the start of a project. How we approach it is under Laravel development.

FAQ

Häufige Fragen

Is MVC not long out of date?
The argument exists, and it usually turns on three drawers being too few for large applications. That is true as well. They are a good starting point all the same, and further layers get added when they are needed. Knowing first where something does not belong is worth more than any architecture debate.

Related

Terms that belong with this one

A project, or a question?

Write and tell us what it is about. You get an assessment from somebody who works with Laravel themselves, not from a sales desk.