return new class extends Migration {
public function up()
{
Schema::create('blog_category', function (Blueprint $table) {
$table->foreignIdFor(Blog::class)->constrained()->onDelete('cascade');
$table->foreignIdFor(Category::class)->constrained()->onDelete('cascade');
$table->primary(['blog_id', 'category_id']);
$table->index('blog_id');
$table->index('category_id');
});
}