
Good content takes time and effort to come up with.
Please consider supporting us by just disabling your AD BLOCKER and reloading this page again.
Sometimes, when you write blogs or any website then you might need to get any random rows to display.
inRandomOrder
To Get Random RowsWith the help of inRandomOrder
we can get the random rows.
$randomPosts = Post::inRandomOrder()->get();
But wait this will get all the random generated posts. You can use the limit the rows in the following way
$randomPosts = Post::published()->inRandomOrder()->limit(15)->get();
return view($this->getView('post.show'), [
'post' => $post,
'randomPosts' => $randomPosts
]);
What Is Method Chaining In PHP?
Test Your Local Developing Laravel Web Application From Phone Browser Without Any Software
Google reCAPTCHA Integration In PHP Laravel Forms
Global Data In All Laravel Blade Pages
Setup AMP (Accelerated Mobile Pages) In PHP Laravel
Add Google ADS In AMP (Accelerated Mobile Pages) Website
Create / Save / Download PDF From Blade Template In PHP Laravel
Sass or SCSS @mixin vs @extends vs Placeholder (%)
URL Redirects From Called Functions In Laravel
Detect AdBlocker With Javascript And Increase Website Ads Revenue
Add Analytics To AMP (Accelerated Mobile Pages) HTML Pages