Laravel do gerador de pacotes uuid
//above in controller
use Illuminate\Support\Str;
//in function
$uuid = Str::uuid()->toString();
//terminal
composer require "webpatser/laravel-uuid:^3.0"
Strange Swan