Skip to content
Advertisement

How to use UUID instead of a slug for ticket

I am currently navigating to a ticket using the slug set by the title example blah-blah-blah and want to use uuid instead of 336c64de-5dcb-34bc-9511-a48242b9zzzb. What is the best approach to take for Laravel 8? I am using Laravel Jetstream with Livewire stack.

Current model code

JavaScript

Ticket Migration

JavaScript

Advertisement

Answer

add uuid in migration

JavaScript

if you want to use uuid for foreign key you have to add

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement