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
]);
Global Data In All Laravel Blade Pages
Generate Fake Data In PHP With Faker
Redirect www to a non-www Website Or Vice Versa
Push Files To CPanel / Remote Server using FTP Software FileZilla
Install NGINX In Linux / Ubuntu And Managing
Facebook Login With PHP Laravel Socialite
Install Linux, NGINX, MYSQL, PHP (LEMP Stack) on Ubuntu
Website Speed and Performance Optimizations
SQLite Doesn't Support Dropping Foreign Keys in Laravel
SummerNote WYSIWYG Text Editor
Detect AdBlocker With Javascript And Increase Website Ads Revenue