Answers for "get random one in laravel eloquent"

PHP
5

laravel get random row

User::all()->random();
User::all()->random(10); // The amount of items you wish to receive
Posted by: Guest on April-22-2020
0

laravel random value from array

$k = array_rand($array);
$v = $array[$k];
Posted by: Guest on January-13-2021

Code answers related to "get random one in laravel eloquent"

Browse Popular Code Answers by Language