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();
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!
More content in Laravel category