Skip to content

Error That Says String to Array Convertion Error #38

@JenuelDev

Description

@JenuelDev
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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions