From 543d8eaca42d002a88b93680249e1afadaa0b062 Mon Sep 17 00:00:00 2001 From: Abdellah El Morabit Date: Mon, 10 Nov 2025 23:10:33 +0100 Subject: [PATCH] [chore] generating the boilerplate --- app/Http/Requests/StoreLessonRequest.php | 28 ++++++++ app/Http/Requests/UpdateLessonRequest.php | 28 ++++++++ app/Models/Group.php | 13 ++++ app/Models/Lesson.php | 12 ++++ app/Models/Student.php | 10 +++ app/Models/SubGroup.php | 11 ++++ app/Models/Teacher.php | 23 +++++++ app/Policies/GroupPolicy.php | 66 +++++++++++++++++++ app/Policies/LessonPolicy.php | 66 +++++++++++++++++++ app/Policies/StudentPolicy.php | 66 +++++++++++++++++++ app/Policies/SubGroupPolicy.php | 66 +++++++++++++++++++ database/factories/GroupFactory.php | 23 +++++++ database/factories/LessonFactory.php | 23 +++++++ database/factories/StudentFactory.php | 23 +++++++ database/factories/SubGroupFactory.php | 23 +++++++ ...2025_11_10_215941_create_groups_table.php} | 7 +- ...5_11_10_215949_create_sub_groups_table.php | 27 ++++++++ ...2025_11_10_220620_create_lessons_table.php | 27 ++++++++ .../2025_11_10_220630_create_groups_table.php | 27 ++++++++ ...5_11_10_220810_create_sub_groups_table.php | 27 ++++++++ ...25_11_10_220818_create_students_table.php} | 14 ++-- database/seeders/GroupSeeder.php | 17 +++++ database/seeders/LessonSeeder.php | 17 +++++ database/seeders/StudentSeeder.php | 17 +++++ database/seeders/SubGroupSeeder.php | 17 +++++ resources/views/welcome.blade.php | 19 ++++-- 26 files changed, 680 insertions(+), 17 deletions(-) create mode 100644 app/Http/Requests/StoreLessonRequest.php create mode 100644 app/Http/Requests/UpdateLessonRequest.php create mode 100644 app/Models/Group.php create mode 100644 app/Models/Lesson.php create mode 100644 app/Models/Student.php create mode 100644 app/Models/SubGroup.php create mode 100644 app/Models/Teacher.php create mode 100644 app/Policies/GroupPolicy.php create mode 100644 app/Policies/LessonPolicy.php create mode 100644 app/Policies/StudentPolicy.php create mode 100644 app/Policies/SubGroupPolicy.php create mode 100644 database/factories/GroupFactory.php create mode 100644 database/factories/LessonFactory.php create mode 100644 database/factories/StudentFactory.php create mode 100644 database/factories/SubGroupFactory.php rename database/migrations/{2025_11_05_145626_group.php => 2025_11_10_215941_create_groups_table.php} (66%) create mode 100644 database/migrations/2025_11_10_215949_create_sub_groups_table.php create mode 100644 database/migrations/2025_11_10_220620_create_lessons_table.php create mode 100644 database/migrations/2025_11_10_220630_create_groups_table.php create mode 100644 database/migrations/2025_11_10_220810_create_sub_groups_table.php rename database/migrations/{2025_11_05_145621_class.php => 2025_11_10_220818_create_students_table.php} (51%) create mode 100644 database/seeders/GroupSeeder.php create mode 100644 database/seeders/LessonSeeder.php create mode 100644 database/seeders/StudentSeeder.php create mode 100644 database/seeders/SubGroupSeeder.php diff --git a/app/Http/Requests/StoreLessonRequest.php b/app/Http/Requests/StoreLessonRequest.php new file mode 100644 index 0000000..b4bac85 --- /dev/null +++ b/app/Http/Requests/StoreLessonRequest.php @@ -0,0 +1,28 @@ +|string> + */ + public function rules(): array + { + return [ + // + ]; + } +} diff --git a/app/Http/Requests/UpdateLessonRequest.php b/app/Http/Requests/UpdateLessonRequest.php new file mode 100644 index 0000000..d913614 --- /dev/null +++ b/app/Http/Requests/UpdateLessonRequest.php @@ -0,0 +1,28 @@ +|string> + */ + public function rules(): array + { + return [ + // + ]; + } +} diff --git a/app/Models/Group.php b/app/Models/Group.php new file mode 100644 index 0000000..7196661 --- /dev/null +++ b/app/Models/Group.php @@ -0,0 +1,13 @@ + */ + use HasFactory; +} diff --git a/app/Models/Student.php b/app/Models/Student.php new file mode 100644 index 0000000..77e2f16 --- /dev/null +++ b/app/Models/Student.php @@ -0,0 +1,10 @@ +hasMany(Group::class); + + } +} diff --git a/app/Policies/GroupPolicy.php b/app/Policies/GroupPolicy.php new file mode 100644 index 0000000..12280d7 --- /dev/null +++ b/app/Policies/GroupPolicy.php @@ -0,0 +1,66 @@ + + */ +class GroupFactory extends Factory +{ + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + // + ]; + } +} diff --git a/database/factories/LessonFactory.php b/database/factories/LessonFactory.php new file mode 100644 index 0000000..5249dc6 --- /dev/null +++ b/database/factories/LessonFactory.php @@ -0,0 +1,23 @@ + + */ +class LessonFactory extends Factory +{ + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + // + ]; + } +} diff --git a/database/factories/StudentFactory.php b/database/factories/StudentFactory.php new file mode 100644 index 0000000..b2fb77e --- /dev/null +++ b/database/factories/StudentFactory.php @@ -0,0 +1,23 @@ + + */ +class StudentFactory extends Factory +{ + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + // + ]; + } +} diff --git a/database/factories/SubGroupFactory.php b/database/factories/SubGroupFactory.php new file mode 100644 index 0000000..0e651f9 --- /dev/null +++ b/database/factories/SubGroupFactory.php @@ -0,0 +1,23 @@ + + */ +class SubGroupFactory extends Factory +{ + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + // + ]; + } +} diff --git a/database/migrations/2025_11_05_145626_group.php b/database/migrations/2025_11_10_215941_create_groups_table.php similarity index 66% rename from database/migrations/2025_11_05_145626_group.php rename to database/migrations/2025_11_10_215941_create_groups_table.php index 88fa2f3..d9fae19 100644 --- a/database/migrations/2025_11_05_145626_group.php +++ b/database/migrations/2025_11_10_215941_create_groups_table.php @@ -11,7 +11,10 @@ return new class extends Migration */ public function up(): void { - // + Schema::create('groups', function (Blueprint $table) { + $table->id(); + $table->timestamps(); + }); } /** @@ -19,6 +22,6 @@ return new class extends Migration */ public function down(): void { - // + Schema::dropIfExists('groups'); } }; diff --git a/database/migrations/2025_11_10_215949_create_sub_groups_table.php b/database/migrations/2025_11_10_215949_create_sub_groups_table.php new file mode 100644 index 0000000..11cf20c --- /dev/null +++ b/database/migrations/2025_11_10_215949_create_sub_groups_table.php @@ -0,0 +1,27 @@ +id(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('sub_groups'); + } +}; diff --git a/database/migrations/2025_11_10_220620_create_lessons_table.php b/database/migrations/2025_11_10_220620_create_lessons_table.php new file mode 100644 index 0000000..11574ea --- /dev/null +++ b/database/migrations/2025_11_10_220620_create_lessons_table.php @@ -0,0 +1,27 @@ +id(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('lessons'); + } +}; diff --git a/database/migrations/2025_11_10_220630_create_groups_table.php b/database/migrations/2025_11_10_220630_create_groups_table.php new file mode 100644 index 0000000..d9fae19 --- /dev/null +++ b/database/migrations/2025_11_10_220630_create_groups_table.php @@ -0,0 +1,27 @@ +id(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('groups'); + } +}; diff --git a/database/migrations/2025_11_10_220810_create_sub_groups_table.php b/database/migrations/2025_11_10_220810_create_sub_groups_table.php new file mode 100644 index 0000000..11cf20c --- /dev/null +++ b/database/migrations/2025_11_10_220810_create_sub_groups_table.php @@ -0,0 +1,27 @@ +id(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('sub_groups'); + } +}; diff --git a/database/migrations/2025_11_05_145621_class.php b/database/migrations/2025_11_10_220818_create_students_table.php similarity index 51% rename from database/migrations/2025_11_05_145621_class.php rename to database/migrations/2025_11_10_220818_create_students_table.php index 8c93632..feeac2a 100644 --- a/database/migrations/2025_11_05_145621_class.php +++ b/database/migrations/2025_11_10_220818_create_students_table.php @@ -11,15 +11,9 @@ return new class extends Migration */ public function up(): void { - Schema::create('class', function(Blueprint $table) - { - $table->id('name'); - $table->string('name'); - $table->foreignId('teacher_id'); - $table->time('start_time'); - $table->time('end_time'); - - // amount of students can be calculated + Schema::create('students', function (Blueprint $table) { + $table->id(); + $table->timestamps(); }); } @@ -28,6 +22,6 @@ return new class extends Migration */ public function down(): void { - Schema::drop('class'); + Schema::dropIfExists('students'); } }; diff --git a/database/seeders/GroupSeeder.php b/database/seeders/GroupSeeder.php new file mode 100644 index 0000000..1e72ffd --- /dev/null +++ b/database/seeders/GroupSeeder.php @@ -0,0 +1,17 @@ + -Hello +Teacher's Journal - - -Hello world - + +
+
    +
  • home
  • +
  • about
  • +
  • login
  • +
  • register
  • +
+
+ Document the courses you've teached. + +