1
I’m learning Laravel
by a channel, and left me doubt... How should I create my Controllers
? As far as I understand it, the view
asks for it, the controller
will validate and successfully calls the model
.
But my general question is... How should I structure my controllers? For example:
Views
are what the user sees, so it is easy to distinguish that they will be pages.
Models
are database structures (tables)
And Controllers
enters as what classification? I need a Controller
for every page I have? My only information I have that they use functions.
I do not know if it was clear enough to understand the question, anything I change, but the summary would be...
How to structure a Controller
in the Laravel
?
PS: Making it clear, I’m new to programming and I really liked the framework Laravel
, for the things he does along with PHP Artisan
Thanks! I just saw a video about SOLID from an MVC man and helped me a lot to understand how I should use and etc... I just didn’t quite understand the D part... I was very confused at the time.
– Devprogramacao
DIP: would be the inversion principle , talks about decoupling. I found a link that has illustrations can help understand. http://ramonsilva.net/boas-praticas/solid/inversao-dependencies/
– Ricardo Lucas