novafieldcheckboxes icon indicating copy to clipboard operation
novafieldcheckboxes copied to clipboard

Error That Says String to Array Convertion Error

Open JenuelDev opened this issue 4 years ago • 0 comments

return [
            ID::make(__('ID'), 'id')->sortable(),
            Text::make('Title')->rules(['required']),
            Trix::make('Body')->rules(['required']),
            Boolean::make('Is Published'),
            BelongsTo::make('User')->rules(['required']),
            Checkboxes::make('Categories')->options(PostCategories::pluck('name')->toArray()),
            Checkboxes::make('Tags')->options(PostTags::pluck('tag')->toArray()),
        ];

this is my migration

Schema::create('posts', function(Blueprint $table) {
            $table->id();
            $table->integer('user_id')->nullable(false);
            $table->string('title')->nullable(false);
            $table->string('tags');
            $table->text('body')->nullable(false);
            $table->string('category');
            $table->string('is_published')->default(false);
            $table->timestamps();
        });

but after I click submit this shows up. image

JenuelDev avatar Mar 08 '21 11:03 JenuelDev