public function getRandomPost() {
$post = Post::inRandomOrder()->first();
return redirect()->route('posts.show', ["id" => $post->id]);
}
but I need to get random post not from all but only from approved posts (where is_approved = 1) and not deleted (I use Soft Deleting). What is the best way to do that?