Skip to content

Commit c1f9c5a

Browse files
committed
Add notes fields on registration page
1 parent 01664f1 commit c1f9c5a

File tree

4 files changed

+33
-3
lines changed

4 files changed

+33
-3
lines changed

app/Http/Controllers/UserController.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,7 @@ public function postRegister(Request $request)
237237
$email = $request->get('email2');
238238
$country = $request->get('country');
239239
$institution = $request->get('institution');
240+
$notes = $request->get('notes');
240241

241242
// check it's not a bot
242243
$honey_pot_email = $request->get('email');
@@ -247,7 +248,7 @@ public function postRegister(Request $request)
247248

248249
$password = str_random(24);
249250

250-
$u = User::add($first_name, $last_name, $email, $password, $country, $institution);
251+
$u = User::add($first_name, $last_name, $email, $password, $country, $institution, $notes);
251252

252253
$t = [];
253254
$t['app_url'] = config('app.url');

app/User.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function generateUsername()
6060
return $username;
6161
}
6262

63-
public static function add($first_name, $last_name, $email, $password, $country, $institution)
63+
public static function add($first_name, $last_name, $email, $password, $country, $institution, $notes)
6464
{
6565
$user = new User();
6666

@@ -69,6 +69,7 @@ public static function add($first_name, $last_name, $email, $password, $country,
6969
$user->email = $email;
7070
$user->country = $country;
7171
$user->institution = $institution;
72+
$user->notes = $notes;
7273

7374
$user->username = $user->generateUsername();
7475
$user->password = Hash::make($password);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
3+
use Illuminate\Database\Migrations\Migration;
4+
use Illuminate\Database\Schema\Blueprint;
5+
use Illuminate\Support\Facades\Schema;
6+
7+
return new class extends Migration
8+
{
9+
public function up()
10+
{
11+
Schema::table('user', function ($table) {
12+
$table->text('notes')->nullable();
13+
});
14+
}
15+
16+
public function down()
17+
{
18+
Schema::table('user', function ($table) {
19+
$table->dropColumn('notes');
20+
});
21+
}
22+
};

resources/views/user/register.blade.php

+7-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
<div class="row">
1919

20-
<div class="col-md-5">
20+
<div class="col-md-6">
2121
{{ Form::open(array('url' => 'register', 'role' => 'form')) }}
2222
<div class="honey-pot">
2323
<label for="email">Do no fill this field, it's used to prevent spam</label>
@@ -43,6 +43,12 @@
4343
<a href="/user/forgot-password/{{ old('email2') }}">Forgot your password?</a>
4444
@endif
4545
</div>
46+
47+
<div class="form-group {{ $errors->first('notes') ? 'has-error' : ''}}">
48+
{{ Form::label('notes', 'Tell us about yourself and your interest in the iReceptor Gateway') }} <span class="error">{{ $errors->first('notes') }}</span>
49+
{{ Form::textarea('notes', '', array('class' => 'form-control')) }}
50+
</div>
51+
4652
</div>
4753
</div>
4854

0 commit comments

Comments
 (0)