O
O
Ogureccc2019-10-07 11:19:28
Laravel
Ogureccc, 2019-10-07 11:19:28

How to correctly implement adding a task with a unique ID?

There are several operators, each of them simultaneously adds tasks to the database. How can I get its id before saving it in the database when creating a task if they are added by auto-increment, and each operator must have a unique id?
I am using crud generator voyager. In the old version, an empty application was created and the page for editing it was opened, and if the operator suddenly canceled the creation or went to another page, then with some crutches the empty application was deleted from the database, there are so many unnecessary extra requests, I think there is some kind of algorithm to avoid this. Who decides to help write the details. Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Eugene, 2019-10-07
@Nc_Soft

Use uuid
https://laravel.com/docs/6.x/helpers#method-str-uuid

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question