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
]);
Unable to prepare route [{fallbackPlaceholder}] for serialization. Uses Closure In Laravel
Cache Static Files With NGINX Server
Install RabbitMQ with Docker & Running with NodeJS
Free SSL Certificate With Lets Encrypt/Certbot In Linux (Single / Multiple Domains)
Install Linux, Apache, MYSQL, PHP (LAMP Stack) on Ubuntu
Setup MAMP Virtual Hosts For Local PHP Development
Generate RSS Feeds in PHP Laravel
Create Custom 404 Page In Laravel
Sass or SCSS @function vs @mixin
Move Uploaded Files From Local Computer Or Server To Amazon S3 Bucket In PHP
Route Model Binding In Laravel & Change Default Column id To Another Column
Comment And Like System Using Disqus
Detect AdBlocker With Javascript And Increase Website Ads Revenue