I know that most PHP frameworks use the MVC
pattern. Where expensive thing (theoretically) should stay in its place.
For example, controllers are responsible for the request and stuff, models are database abstractions, and view is the view layer.
But I've seen some programmers who do, for example, queries using the model within the preview layer.
An example:
@foreach(Estado::where($usuario->estado_id)->where('status', '=', 1)->get() as $estado)
<div>{{ $estado->nome }}</div>
@endforeach
I notice that it gets very disorganized when this occurs.
So I want to know if, Considering the MVC pattern , is this a bad practice, or can it be considered an error on the part of the programmer?