Answers for "show random post in laravel"

PHP
0

show random post in laravel

public function getRandomPost() {
        $post = Post::inRandomOrder()->first();
        return redirect()->route('posts.show', ["id" => $post->id]);
    }
Posted by: Guest on August-18-2020

Browse Popular Code Answers by Language