I am writing a web application using PHP without using any framework 'just for learning'.
My app consists of a small routing system, MVC components, some entities that represents the database tables and repository classes that deals with the database.
The controller crate a repository object and that object load its entities from the database then return it as an array to the controller and the controller render the data.
What is the right place to put the domain or business logic,
in the models or repositories
View > Controller > Model > Repository > Database
View < Controller < Model < Repository < Database