UUID in Arabic and eloquent

Asked

Viewed 168 times

0

Well I know that in Laravel some new UUID methods have been added in this package

use Illuminate\Support\Str;

but what its not how to use in eloquent, can anyone help me to know how to modify the Mbo id in Migrations to receive UUID? How do I save UUID automatically or will I have to generate every time I register a record in the table? And I treat UUID like ID to pass between routes?

How do I use this?

Str::uuid();
Str::orderedUuid();

Somebody save me please?

  • Your Laravel is the one that’s on the tag?

1 answer

1


In the Laravel documentation it asks you to declare (string) after var equals as follows in the example:

$uuid = (string) Str::uuid();

dd($uuid); // return "891fcc8e-018e-43ed-b2cf-f8f98bca70d5"

Documentation link: https://laravel.com/docs/5.8/helpers#method-str-uuid

Browser other questions tagged

You are not signed in. Login or sign up in order to post.