diff --git a/app/Http/Controllers/AnswerController.php b/app/Http/Controllers/AnswerController.php new file mode 100644 index 0000000..e1ee9bd --- /dev/null +++ b/app/Http/Controllers/AnswerController.php @@ -0,0 +1,66 @@ +id(); + $table->unsignedBigInteger('student_id')->index(); + $table->unsignedBigInteger('course_id')->index(); + $table->timestamp('enrollment_date')->default(now()); + $table->timestamps(); + $table->softDeletes(); + + $table->foreign('student_id')->references('id')->on('students')->onDelete('cascade'); + $table->foreign('course_id')->references('id')->on('courses')->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('enrollments'); + } +}; diff --git a/database/migrations/2023_11_26_153620_create_materials_table.php b/database/migrations/2023_11_26_153620_create_materials_table.php new file mode 100644 index 0000000..10dfc8a --- /dev/null +++ b/database/migrations/2023_11_26_153620_create_materials_table.php @@ -0,0 +1,34 @@ +id(); + $table->unsignedBigInteger('course_id')->index(); + $table->string('title', 255)->nullable(false); + $table->enum('type', ['video', 'document', 'quiz'])->nullable(false); + $table->text('content_url')->nullable(); + $table->timestamps(); + $table->softDeletes(); + + $table->foreign('course_id')->references('id')->on('courses')->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('materials'); + } +}; diff --git a/database/migrations/2023_11_26_153639_create_quizzes_table.php b/database/migrations/2023_11_26_153639_create_quizzes_table.php new file mode 100644 index 0000000..5e1f56b --- /dev/null +++ b/database/migrations/2023_11_26_153639_create_quizzes_table.php @@ -0,0 +1,32 @@ +id(); + $table->unsignedBigInteger('course_id')->index(); + $table->string('title', 255)->nullable(false); + $table->timestamps(); + $table->softDeletes(); + + $table->foreign('course_id')->references('id')->on('courses')->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('quizzes'); + } +}; diff --git a/database/migrations/2023_11_26_153659_create_questions_table.php b/database/migrations/2023_11_26_153659_create_questions_table.php new file mode 100644 index 0000000..fc827a7 --- /dev/null +++ b/database/migrations/2023_11_26_153659_create_questions_table.php @@ -0,0 +1,33 @@ +id(); + $table->unsignedBigInteger('quiz_id')->index(); + $table->text('content')->nullable(false); + $table->enum('type', ['multiple_choice', 'true_false', 'short_answer'])->nullable(false); + $table->timestamps(); + $table->softDeletes(); + + $table->foreign('quiz_id')->references('id')->on('quizzes')->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('questions'); + } +}; diff --git a/database/migrations/2023_11_26_153719_create_answers_table.php b/database/migrations/2023_11_26_153719_create_answers_table.php new file mode 100644 index 0000000..62987b8 --- /dev/null +++ b/database/migrations/2023_11_26_153719_create_answers_table.php @@ -0,0 +1,34 @@ +id(); + $table->unsignedBigInteger('student_id')->index(); + $table->unsignedBigInteger('question_id')->index(); + $table->text('answer')->nullable(); + $table->timestamps(); + $table->softDeletes(); + + $table->foreign('student_id')->references('id')->on('students')->onDelete('cascade'); + $table->foreign('question_id')->references('id')->on('questions')->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('answers'); + } +}; diff --git a/database/migrations/2023_11_26_153735_create_reviews_table.php b/database/migrations/2023_11_26_153735_create_reviews_table.php new file mode 100644 index 0000000..c8c0cbe --- /dev/null +++ b/database/migrations/2023_11_26_153735_create_reviews_table.php @@ -0,0 +1,27 @@ +id(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('reviews'); + } +}; diff --git a/database/migrations/2023_11_26_153754_create_payments_table.php b/database/migrations/2023_11_26_153754_create_payments_table.php new file mode 100644 index 0000000..d7c31e5 --- /dev/null +++ b/database/migrations/2023_11_26_153754_create_payments_table.php @@ -0,0 +1,27 @@ +id(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('payments'); + } +}; diff --git a/database/migrations/2023_11_26_153818_create_subscriptions_table.php b/database/migrations/2023_11_26_153818_create_subscriptions_table.php new file mode 100644 index 0000000..eed16ea --- /dev/null +++ b/database/migrations/2023_11_26_153818_create_subscriptions_table.php @@ -0,0 +1,27 @@ +id(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('subscriptions'); + } +}; diff --git a/database/migrations/2023_11_26_153844_create_progress_table.php b/database/migrations/2023_11_26_153844_create_progress_table.php new file mode 100644 index 0000000..02bf3b8 --- /dev/null +++ b/database/migrations/2023_11_26_153844_create_progress_table.php @@ -0,0 +1,27 @@ +id(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('progress'); + } +}; diff --git a/database/migrations/2023_11_26_153902_create_discussions_table.php b/database/migrations/2023_11_26_153902_create_discussions_table.php new file mode 100644 index 0000000..e1f52e6 --- /dev/null +++ b/database/migrations/2023_11_26_153902_create_discussions_table.php @@ -0,0 +1,27 @@ +id(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('discussions'); + } +}; diff --git a/database/migrations/2023_11_26_153916_create_messages_table.php b/database/migrations/2023_11_26_153916_create_messages_table.php new file mode 100644 index 0000000..c82dd59 --- /dev/null +++ b/database/migrations/2023_11_26_153916_create_messages_table.php @@ -0,0 +1,27 @@ +id(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('messages'); + } +}; diff --git a/resources/views/backend/layouts/app.blade.php b/resources/views/backend/layouts/app.blade.php index ce7a09a..d741339 100644 --- a/resources/views/backend/layouts/app.blade.php +++ b/resources/views/backend/layouts/app.blade.php @@ -190,20 +190,10 @@ class="feather feather-log-out">