diff --git a/app/Http/Controllers/ProfileController.php b/app/Http/Controllers/ProfileController.php new file mode 100644 index 000000000..815a14ce4 --- /dev/null +++ b/app/Http/Controllers/ProfileController.php @@ -0,0 +1,10 @@ +has('profile')->count() == 0) { + $profile = new Profile; + $profile->user_id = $user->id; + $profile->username = $user->username; + $profile->save(); + } + } + +} \ No newline at end of file diff --git a/app/Profile.php b/app/Profile.php new file mode 100644 index 000000000..2cb0b4635 --- /dev/null +++ b/app/Profile.php @@ -0,0 +1,10 @@ +hasOne(Profile::class); + } } diff --git a/database/migrations/2018_04_16_002611_create_profiles_table.php b/database/migrations/2018_04_16_002611_create_profiles_table.php new file mode 100644 index 000000000..4014e8cd4 --- /dev/null +++ b/database/migrations/2018_04_16_002611_create_profiles_table.php @@ -0,0 +1,40 @@ +increments('id'); + $table->unsignedInteger('user_id')->nullable(); + $table->string('username')->nullable()->unique()->index(); + $table->string('name')->nullable(); + $table->string('bio', 150)->nullable(); + $table->string('location')->nullable(); + $table->string('website')->nullable(); + $table->string('remote_url')->nullable(); + $table->text('keybase_proof')->nullable(); + $table->boolean('is_private')->default(false); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('profiles'); + } +}