app/TodoItem.php
/**
     * Autofill the uuid field when the model instance is being created.
     */
Autofill the uuid field when the model instance is being created.
Autofill the uuid field when the model instance is being created .
protected static function boot()
    {
        parent::boot();
        self::creating(function($todoInstance) {
            $todoInstance->uuid = Uuid::uuid4()->toString();
        });
    }
protected static function boot ( ) { parent :: boot ( ) ; self :: creating ( function ( $ todoInstance ) { $ todoInstance -> uuid = Uuid :: uuid4 ( ) -> toString ( ) ; } ) ; }
Autofill the uuid field when the model instance is being created.
Autofill the uuid field when the model instance is being created .