Laravel Order случайно
$galleries = App\Gallery::inRandomOrder()->get();
//Or
DB::table('gallery')->inRandomOrder()->get();
Stormy Serval
$galleries = App\Gallery::inRandomOrder()->get();
//Or
DB::table('gallery')->inRandomOrder()->get();
$randomUser = DB::table('users')
->inRandomOrder()
->first();
User::all()->random();
User::all()->random(10); // The amount of items you wish to receive
Model::select('column')->where('column','value')->inRandomOrder()
->limit(2) // here is yours limit
->get();
------------------ OR --------------------
Model::inRandomOrder()->select('column')->where('column','value')->first();