Currently working on lost and found project where users can make a report when they left something behind.
I'm using laravel 5.4, I have some data already on my DB and I have made every requirements according to my client. But in the end, my client want me to add unique report number ticket for every report that has been made. I've googled it but I can't find tutorial that is similar to my case
I'm totally newbie on programming, any help would be much appreciated.
There's a lot of ways you can do so, but the following two sprint to mind:
$date = new DateTime('now');
echo $id = $date->format('Y-m-d') . "-" . str_pad($ticket->id, 6, "0", STR_PAD_LEFT);
composer require ramsey/uuid
. Then you can generate your random numbers like so:$uuid4 = Uuid::uuid4();
echo $uuid4->toString(); // i.e. 25769c6c-d34d-4bfe-ba98-e0ee856f3e7a