jeudi 6 juin 2019

More than one random row in view in Laravel

I'm absolutely new to Laravel and I've been trying to do such a thing (or wondering if its possible).

I have a table with 800 matches (match name, date etc.) and I wanted to pick random, lets say, 10, and pass those ten matches names to view. When I pick one it's no problem, I pass it to view in for each loop - I declare one variable in controller and pass it.

But I've been wondering if its possible to pass either more variables with random Match each. Like i have variables match1, Match2, Match3, and if its possible to get them in view somehow and view them there.

And I've been stuck here, so if anybody could help me I would be grateful.




Aucun commentaire:

Enregistrer un commentaire