create random_str laravel

PHP
use Illuminate\Support\Str;

$random = Str::random(40);
Source

Also in PHP: