classes/Models/Base.php
public function scopeRandomize($query, $seed = false)
    {
        if ($seed === true) {
            $seed = Session::getId();
        }

        if ($seed) {
            return $query->orderBy(DB::raw('RAND("'.$seed.'")'));
        }

        return $query->orderBy(DB::raw('RAND()'));
    }
public function scopeRandomize($query, $seed = false)
    {
        if ($seed === true) {
            $seed = Session::getId();
        }

        if ($seed) {
            return $query->orderBy(DB::raw('RAND("'.$seed.'")'));
        }

        return $query->orderBy(DB::raw('RAND()'));
    }
public function scopeRandomize ( $ query , $ seed = false ) { if ( $ seed === true ) { $ seed = Session :: getId ( ) ; } if ( $ seed ) { return $ query -> orderBy ( DB :: raw ( 'RAND("' . $ seed . '")' ) ) ; } return $ query -> orderBy ( DB :: raw ( 'RAND()' ) ) ; }
Randomize the results in the DB.  This shouldn't be used for large datasets
cause it's not very performant

@param  Illuminate\Database\Query\Builder $query
@param  mixed                             $seed  Providing a seed keeps the order the same on subsequent queries
@return Illuminate\Database\Query\Builder
Randomize the results in the DB . This shouldn t be used for large datasets cause it s not very performant