V
V
Vlad Saenko2020-11-03 12:30:17
Laravel
Vlad Saenko, 2020-11-03 12:30:17

How to pass the desired model to the function immediately?

There are view statistics for the product, account, and movies (let's assume), their views are counted in the same views table using a polymorphic relationship.
It is necessary to immediately transfer the desired model to the controller, because searching by ID is not an option, there will be matches.
Actually the question itself is how to pass the desired model as a parameter to the function right away ?!

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question