Answers for "generate random number php laravel"

PHP
8

laravel Str::random

use Illuminate\Support\Str;

$random = Str::random(40);
Posted by: Guest on June-06-2020
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

Code answers related to "generate random number php laravel"

Browse Popular Code Answers by Language