Sounds like a DB session is better in that instance. Not sure if you want to persist the data. But, the docs here
Dec 21, 2016
2
Level 2
Laravel 5.3 - Storing and retreiving multiple key-value pairs in session
Hi there,
I'm using Laravel 5.3 to build a quiz and I would like to store the results in the session. So, each time the user submits a quiz response, the result is added to the session array.
For example I would like to store the answers something like this:
answers = [q1=correct, q2=correct, q3=incorrect,...]
Then at the end pf the quiz, I want to be able to retrieve and list the results and perhaps style the correct answers green and the wring answers red.
Could anybody provide any guidance on how to achieve this?
Many Thanks,
Loquela
Level 53
Please or to participate in this conversation.