diff --git a/app/Http/Controllers/RegistrationController.php b/app/Http/Controllers/RegistrationController.php index a94e6b3..5996ee8 100644 --- a/app/Http/Controllers/RegistrationController.php +++ b/app/Http/Controllers/RegistrationController.php @@ -65,11 +65,29 @@ class RegistrationController extends Controller { $this->validate(request(), [ 'name' => 'required', + 'surname' => 'required', 'email' => 'required|email', - 'password' => 'required' + 'password' => 'required', + 'login' => 'required', + 'PESEL' => 'required', + 'phoneNumber' => 'required' + ]); - $user = User::create(request(['name', 'email', 'password', 'testowa'])); + + $request = request(); + $user = User::create([ + 'login' => $request-> login, + 'password' => $request-> password, + 'email' => $request-> email, + 'name' => $request-> name, + 'surname' => $request-> surname, + 'PESEL' => $request-> PESEL, + 'phoneNumber' => $request-> phoneNumber, + 'functionID' => 1, + 'degreeID' => 1, + 'number' => 'ABC123' + ]); auth()->login($user); diff --git a/app/User.php b/app/User.php index 9d1fd77..0c8ce08 100644 --- a/app/User.php +++ b/app/User.php @@ -11,13 +11,14 @@ class User extends Authenticatable { use Notifiable; + protected $primaryKey = 'id'; /** * The attributes that are mass assignable. * * @var array */ protected $fillable = [ - 'name', 'email', 'password', 'testowa' + 'login', 'name', 'surname', 'password', 'PESEL', 'phoneNumber', 'email', 'fireStationID', 'functionID', 'degreeID', 'number', 'statusID', 'deleted', 'creatorID', 'changingID', ]; /** diff --git a/database/migrations/2014_10_12_000000_create_users_table.php b/database/migrations/2014_10_12_000000_create_users_table.php index 16a6108..3d895e1 100644 --- a/database/migrations/2014_10_12_000000_create_users_table.php +++ b/database/migrations/2014_10_12_000000_create_users_table.php @@ -15,10 +15,22 @@ class CreateUsersTable extends Migration { Schema::create('users', function (Blueprint $table) { $table->increments('id'); - $table->string('name'); - $table->string('email')->unique(); + $table->string('login', 45); + $table->string('password', 100); + $table->string('name', 45); + $table->string('surname', 45); + $table->string('PESEL',11); + $table->string('phoneNumber', 9); + $table->string('email', 50)->unique(); + $table->integer('fireStationID')->nullable(); + $table->integer('functionID'); + $table->integer('degreeID'); + $table->string('number', 45)->nullable()->default(null); + $table->integer('statusID')->default(0); + $table->integer('deleted')->default(0); + $table->integer('creatorID')->nullable()->default(null); + $table->integer('changingID')->nullable()->default(null); $table->timestamp('email_verified_at')->nullable(); - $table->string('password'); $table->rememberToken(); $table->timestamps(); }); diff --git a/resources/views/register.blade.php b/resources/views/register.blade.php index 6db4f11..0353978 100644 --- a/resources/views/register.blade.php +++ b/resources/views/register.blade.php @@ -63,10 +63,30 @@
{{ csrf_field() }}
- +
+
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+
@@ -77,11 +97,6 @@
-
- - -
-