diff --git a/app/Attendance.php b/app/Attendance.php new file mode 100644 index 0000000..44551a7 --- /dev/null +++ b/app/Attendance.php @@ -0,0 +1,12 @@ + ['required', 'string', 'max:255'], + 'surname' => ['required', 'string', 'max:255'], 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'], 'password' => ['required', 'string', 'min:8', 'confirmed'], ]); @@ -65,6 +66,7 @@ class RegisterController extends Controller { return User::create([ 'name' => $data['name'], + 'surname' => $data['surname'], 'email' => $data['email'], 'password' => Hash::make($data['password']), ]); diff --git a/app/Room.php b/app/Room.php new file mode 100644 index 0000000..c6b0129 --- /dev/null +++ b/app/Room.php @@ -0,0 +1,12 @@ +bigIncrements('id'); $table->string('name'); + $table->string('surname'); $table->string('email')->unique(); $table->timestamp('email_verified_at')->nullable(); $table->string('password'); diff --git a/database/migrations/2019_11_26_232020_create_classes_table.php b/database/migrations/2019_11_26_232020_create_classes_table.php new file mode 100644 index 0000000..3465579 --- /dev/null +++ b/database/migrations/2019_11_26_232020_create_classes_table.php @@ -0,0 +1,35 @@ +bigIncrements('id'); + $table->integer('subject_id'); + $table->date('date'); + $table->timestamps(); + $table->foreign('subject_id')->references('id')->on('subjects'); + + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('classes'); + } +} diff --git a/database/migrations/2019_11_26_232906_create_subjects_table.php b/database/migrations/2019_11_26_232906_create_subjects_table.php new file mode 100644 index 0000000..0ee52cf --- /dev/null +++ b/database/migrations/2019_11_26_232906_create_subjects_table.php @@ -0,0 +1,37 @@ +bigIncrements('id'); + $table->string('name'); + $table->string('type')->nullable(); + $table->integer('room_id'); + $table->integer('user_id'); + $table->timestamps(); + $table->foreign('room_id')->references('id')->on('rooms'); + $table->foreign('user_id')->references('id')->on('users'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('subjects'); + } +} diff --git a/database/migrations/2019_11_26_232945_create_rooms_table.php b/database/migrations/2019_11_26_232945_create_rooms_table.php new file mode 100644 index 0000000..2d7be03 --- /dev/null +++ b/database/migrations/2019_11_26_232945_create_rooms_table.php @@ -0,0 +1,34 @@ +bigIncrements('id'); + $table->string('name'); + $table->integer('capacity')->nullable(); + $table->string('arrangement')->nullable(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('rooms'); + } +} diff --git a/database/migrations/2019_11_26_233012_create_attendances_table.php b/database/migrations/2019_11_26_233012_create_attendances_table.php new file mode 100644 index 0000000..bdd8041 --- /dev/null +++ b/database/migrations/2019_11_26_233012_create_attendances_table.php @@ -0,0 +1,37 @@ +bigIncrements('id'); + $table->integer('classes_id'); + $table->integer('student_id_number'); + $table->string('student_name'); + $table->string('student_surname'); + $table->integer('seat_number'); + $table->timestamps(); + $table->foreign('classes_id')->references('id')->on('classes'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('attendances'); + } +} diff --git a/resources/views/auth/register.blade.php b/resources/views/auth/register.blade.php index d236a48..501a459 100644 --- a/resources/views/auth/register.blade.php +++ b/resources/views/auth/register.blade.php @@ -25,6 +25,20 @@ +
+ + +
+ + + @error('name') + + {{ $message }} + + @enderror +
+
+