I have migration for ecommerce: category and product table. I need subcategory table This is shema for category table :
Schema::create('categories', function($table){ $table->increments('id'); $table->string('name'); $table->timestamps(); });
and product shema:
Schema::create('products', function($table){
$table->increments('id');
$table->integer('category_id')->unsigned();
$table->foreign('category_id')->references('id')->on('categories');
$table->string('title');
$table->text('description');
$table->decimal('price', 6, 2);
$table->boolean('availability')->default(1);
$table->string('image');
$table->timestamps();
});
How to make subcategoru shema?
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community