I'm no longer find MVC approach sufficient for all projects and move on to Javascript, Swift, etc, finally settled on Go just before it turns 10th. I'm really appreciate I could build without web framework today.
I'm no longer find MVC approach sufficient for all projects and move on to Javascript, Swift, etc, finally settled on Go just before it turns 10th. I'm really appreciate I could build without web framework today.
Laravel has a "Model" abstraction, but its models are Active Record objects, i.e. database row proxies. The M in MVC is not supposed to be in 1:1 correspondence with your database tables. Laravel's Model class is poorly named.
The closest Laravel would come to being MVC would be by adding your business logic to service classes and adding them to Laravel's service container - an approach that the Laravel documentation mentions as a possibility but doesn't make a big deal of. Indeed, the documentation largely encourages the use of controllers to contain business logic.
(Real) Model -> fetch -> UI Model -> build -> View
^
|
v
build/modify
^
|
v
Controller
The UI Model serves as a simplified version of the "real" model that can also use the data structures/objects used by the technology used in the View.In "original" MVC (outside of the use of this term in webdev), the "M" in MVC absolutely did refer to a 1:1 correspondence with the data at the core of the application. This works too, but when using various UI toolkits, adding the UI Model can make things feel a bit more natural.