Edit File: 2024_09_01_152842_create_category_provider.php
<?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('category_provider', function (Blueprint $table) { $table->id(); // this for Category ID for non parent categories $table->foreignId('category_id')->constrained('categories')->onDelete('cascade'); $table->foreignId('provider_id')->constrained('providers')->onDelete('cascade'); $table->timestamps(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('category_provider'); } };
Back to File Manager