uuid in laravel

76

uuid package generator laravel -

//above in controller
use Illuminate\Support\Str;

//in function
$uuid = Str::uuid()->toString();

//terminal
composer require "webpatser/laravel-uuid:^3.0"

uuid in laravel -

use Illuminate\Support\Str;

$uuid = Str::uuid()->toString();

uuid table laravel -

$table->uuid('id');

uuid laravel -

use Illuminate\Support\Str;

$isUuid = Str::isUuid('a0a2a2d2-0b87-4a18-83f2-2529882be2de');

// true

$isUuid = Str::isUuid('laravel');

// false

Comments

Submit
0 Comments