laravel eloquent randomise data from database

Solutions on MaxInterview for laravel eloquent randomise data from database by the best coders in the world

showing results for - "laravel eloquent randomise data from database"
Ariana
20 Jul 2020
1Model::select('column')
2    ->where('column','value')
3    ->inRandomOrder()
4    ->limit(2) // here is yours limit
5    ->get();
6
Melvyn
07 Sep 2016
1ModelName::where('column',$condition)->random($number)->get();