Answer the question
In order to leave comments, you need to log in
What is going on in laravel models?
Hello. What are models for and what happens in them? I study from a book. They write that they are needed to create connections, event handlers. I still don't understand why they are needed. Explain, please
Answer the question
In order to leave comments, you need to log in
What's that book? Read the official doc, it's very accessible and has a thousand examples.
If you don't understand what laravel models are for, then you don't understand MVC. Google this abbreviation, much will become clearer.
Event handlers are not associated with models.
Relationships, mutators, and other things that are connected specifically with the concept of a model are set in the model. The controller receives data through the model. For example, getting a list of books from a database would look like this:
Laravel has very good documentation. For example here: https://laravel.ru/docs/v5/
I'm not sure that the Russian version is the latest and corresponds to 5.6 - you can see it on the English
version https://laravel.com/docs/5.6
it will give an idea of how it all works with each other and an understanding of what is in Laravel, although everything you need is described in the documentation.
Models are data
View is a representation of data (on the screen)
Controller is data processing
In the case of a WEB site without a framework:
MySKL server works as a model,
HTTP Server works on view , PHP
Server works as a controller.
Laravel has already created blanks for frequently used operations that include all L.A.M.P. programming.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question