Skip to content

Commit

Permalink
add slack username to registration form
Browse files Browse the repository at this point in the history
  • Loading branch information
jcs224 committed Mar 16, 2021
1 parent f409972 commit 6095335
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
2 changes: 2 additions & 0 deletions app/Http/Controllers/Auth/RegisterController.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ protected function validator(array $data)
'last_name' => ['required', 'string', 'max:255'],
'username' => ['required', 'string', 'min:2', 'max:255', 'unique:users'],
'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],
'slack_username' => ['string', 'max:255'],
'password' => ['required', 'string', 'confirmed'],
]);
}
Expand All @@ -60,6 +61,7 @@ protected function create(array $data)
'last_name' => $data['last_name'],
'username' => $data['username'],
'email' => $data['email'],
'slack_username' => $data['slack_username'],
'role_id' => RoleService::getId('user'),
'password' => Hash::make($data['password']),
]);
Expand Down
20 changes: 17 additions & 3 deletions resources/views/auth/register.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@
</p>
@endif
</div>

<div class="flex flex-wrap mb-6">
<label for="username" class="block text-gray-700 text-sm font-bold mb-2">
{{ __('User Name') }}:
</label>

<input id="username" name="username" type="text" class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline{{ $errors->has('name') ? ' border-red-500' : '' }}" name="name" value="{{ old('name') }}" required autofocus>

@if ($errors->has('username'))
<p class="text-red-500 text-xs italic mt-4">
{{ $errors->first('username') }}
Expand All @@ -69,6 +69,20 @@
@endif
</div>

<div class="flex flex-wrap mb-6">
<label for="slack_username" class="block text-gray-700 text-sm font-bold mb-2">
{{ __('Slack Username') }}:
</label>

<input id="slack_username" type="slack_username" class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline{{ $errors->has('slack_username') ? ' border-red-500' : '' }}" name="slack_username" value="{{ old('slack_username') }}" required>

@if ($errors->has('slack_username'))
<p class="text-red-500 text-xs italic mt-4">
{{ $errors->first('slack_username') }}
</p>
@endif
</div>

<div class="flex flex-wrap mb-6">
<label for="password" class="block text-gray-700 text-sm font-bold mb-2">
{{ __('Password') }}:
Expand Down

0 comments on commit 6095335

Please sign in to comment.