Retrieve a Random Record from Your Database

Sometimes we need to retrieve a random record from our DB. By using Eloquent we can easily do what we want:

// Get the random model
$random = Model::inRandomOrder()->first();
Need a web developer? Maybe we can help, get in touch!