Answer the question
In order to leave comments, you need to log in
How to create a pivot table in Eloquent to track downloads?
Hello everyone, stupid question again.
I can't figure out how to correctly, according to Feng Shui, make a connection in Eloquent to account for file downloads by users? The task is basically simple. There are:
1. Model of the file (with description, link, etc.)
2. Model of the user (users own the files) It is
necessary to record downloads by users of files. Those. a pivot table that will store two indexes - a user index and a file index.
But here's the question - how to properly describe this in Eloquent's language? I don’t understand how it should look at the level of connections - who should belong to whom and who should have what?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question