id(); $table->string('title', 255); $table->text('description')->nullable(); $table->enum('type', ['single', 'multiple', 'text']); $table->integer('difficulty'); $table->unsignedBigInteger('category_id')->nullable(); $table->unsignedBigInteger('author_id')->nullable(); $table->text('variants'); $table->text('correct_answers')->default('[]'); $table->foreign('author_id')->references('id')->on('users')->onDelete('set null'); $table->foreign('category_id')->references('id')->on('categories')->onDelete('set null'); $table->timestamps(); }); } /** * Reverse the migrations. */ public function down(): void { Schema::dropIfExists('questions'); } };