Answer the question
In order to leave comments, you need to log in
How to store category attributes?
You need to add attributes to the categories: Color, Size.
Schema::create('advert_attributes', function (Blueprint $table) {
$table->id();
$table->string('name')->unique();
$table->string('slug')->unique();
$table->string('type');
$table->string('required')->nullable();
$table->string('variants')->json();
$table->integer('sort')->default(1);
});
Schema::create('adverts_categories', function (Blueprint $table) {
$table->increments('id');
$table->string('name')->index();
$table->string('slug');
$table->nestedSet();
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question