Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

laravel get random number of data from database

Model::select('column')
    ->where('column','value')
    ->inRandomOrder()
    ->limit(2) // here is yours limit
    ->get();
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #laravel #random #number #data #database
ADD COMMENT
Topic
Name
8+3 =