How to get a random item from Laravel Collection?
< 1 min readTo get a random item from a Laravel collection, you can use the random method. This method will return a random element from the collection, or null if the collection is empty. Here’s an example: You can also pass a number as an argument to the random method to get that number of random elements…
