Thank you for the awesome package! We've stumbled accross an issue where if the initial_value is set to 0 and there are no records in the database, when trying to add a new one, we get:
Gurgentil\LaravelEloquentSequencer\Exceptions\SequenceValueOutOfBoundsException with message 'Sequence value `0` is out of bounds.'
Steps to reproduce:
Change config/eloquentsequencer.php:
'initial_value' => 0
Clear the table for a specific model, in this case, let's assume the model is Theme
Hello,
Thank you for the awesome package! We've stumbled accross an issue where if the
initial_value
is set to 0 and there are no records in the database, when trying to add a new one, we get:Steps to reproduce:
config/eloquentsequencer.php
:Theme
Theme::factory()->create()
The issue comes from the fact that 0 here is always threated as an out-of-bound value. https://github.com/gurgentil/laravel-eloquent-sequencer/blob/fc3454e331ef5680e654778362efda6b08901d44/src/Traits/Sequenceable.php#L158-L165