eloquent-uuid is a Laravel package which we can use to add UUID to a model.

The trait listens to the creating event. It generates a new UUID and saves it in the uuid column on the model.

laravel package

Installation

composer require jamesmills/eloquent-uuid

Source Code

https://github.com/jamesmills/eloquent-uuid