koss-shtukert / laravel-nova-select2-auto-complete

Laravel Nova Select2 Auto-Complete
https://novapackages.com/packages/koss-shtukert/laravel-nova-select2-auto-complete
MIT License
38 stars 11 forks source link

Zero index label #40

Closed iSWORD closed 4 years ago

iSWORD commented 4 years ago

There seems to be an issue when showing the label for the option at index 0 when storing the selected value in an integer database field.

Example:

public function fields(Request $request)
{
    return [
        Select2::make('Type')->options(['Foo', 'Bar', 'Milk']),
        //
    ];
}

Where type is defined as the following in the migration:

public function up()
{
    Schema::create('peanuts', function (Blueprint $table) {
        $table->integer('type')->default(0);
        //
    });
}

When selecting item at index 0 "Foo" it fails to show its label on the show, index or edit views.

Thank you,

koss-shtukert commented 4 years ago

Hello, @iSWORD I'll check and fix this issue as soon as possible, thanks!

koss-shtukert commented 4 years ago

Fixed on Release v1.21