Can Anyone help me with Select Tree plugin!!

Hello I'm new here and first time I'm creating help post so please forgive me if i made any mistake

So my problem Is when I trying to create categories it shows Unknown column 'categories' in 'field list'

so when I do it manually usually i create product first then attach category in there!

here is my code

Schema::create('category_product', function (Blueprint $table) { $table->foreignId('product_id')->constrained('products')->cascadeOnDelete(); $table->foreignId('category_id')->constrained('categories')->cascadeOnDelete(); });

public function categories() { return $this->belongsToMany(Category::class, 'category_product'); }

Section::make('meta')->schema([ FileUpload::make('thumbnail')->disk('products'), SelectTree::make('categories') ->relationship('categories', 'name', 'parent_id'), Checkbox::make('is_active'), ])->columnSpan(1),
Solution
If Anyone was interested the solution was to add
-> dehydrated(false) in the field
Was this page helpful?