Arr::random method returns a random value from an array.


Example:

public function index(){ 
        $arr = ['php', 'laravel', 'html','css'];
        $randomed = Arr::random($arr);
        print_r($randomed);
    }


Output:

html

Thanks, May this example will help you.