michaeldyrynda / laravel-model-uuid

This package allows you to easily work with UUIDs in your Laravel models
MIT License
451 stars 47 forks source link

$bytes string should contain 16 characters error fix #57

Closed ctf0 closed 5 years ago

ctf0 commented 5 years ago

following the docs along with setting the column to $table->uuid('id')->primary(); was giving error of InvalidArgumentException : $bytes string should contain 16 characters. so to fix it we need

public function getIncrementing()
    {
        return false;
    }

to be added as well

michaeldyrynda commented 5 years ago

This is already documented in the readme.

Note: this package explicitly does not disable auto-incrementing on your Eloquent models. In terms of database indexing, it is generally more efficient to use auto-incrementing integers for your internal querying. Indexing your uuid column will make lookups against that column fast, without impacting queries between related models.