Laravel table id table

In Laravel and Eloquent, you can use ManyToMany-Relations with a pivot table. The problem in my case is the automatic id of the summary line. Can I change the way I create an identifier? I want to use the UUID in this regard.

For other objects, you can simply implement this behavior in the Model, but there is no model for summary objects.

Did I miss something?

+4
source share
1 answer

, , , attach(), sync(), / .

, $user->roles()->attach($role, array('id' => $uuid));

, , id .

, id , , - - , 2, .

+6

Source: https://habr.com/ru/post/1546985/


All Articles