class RegisterController extends Controller
{
use RegistersUsers;
protected $redirectTo = RouteServiceProvider::HOME;
public function __construct()
{
$this->middleware('guest');
}
protected function validator(array $data)
{
return Validator::make($data, [
'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],
'password' => ['required', 'string', 'min:8', 'confirmed'],
'skype' => ['required', 'string', 'max:255'],
'telegram' => ['required', 'string', 'max:255'],
'plan' => ['required', 'string', 'max:255'],
]);
}
protected function create(array $data)
{
return User::create([
'email' => $data['email'],
'password' => Hash::make($data['password']),
'skype' => $data['skype'],
'telegram' => $data['telegram'],
'plan' => $data['plan'],
]);
}
}
<main class="input">
<div class="container">
<h2 class="lg__title input__title">Регистрация</h2>
<div class="form__container">
<form action="{{ route('register') }}" method="post">
@csrf
<span class="form__wrapper">
<input type="text" name="email" class="reg__input form__input @error('email') is-invalid @enderror" value="{{ old('email') }}" placeholder="E-mail" autocomplete="email">
@error('email')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
@enderror
<input type="password" name="password" class="reg__input form__input @error('password') is-invalid @enderror" placeholder="Пароль">
@error('password')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
@enderror
<input type="password" name="password_confirmation" class="reg__input form__input" placeholder="Повторите пароль">
<input type="text" name="skype" class="reg__input form__input @error('skype') is-invalid @enderror" value="{{ old('skype') }}" placeholder="Skype" autocomplete="skype">
<input type="text" name="telegram" class="reg__input form__input @error('telegram') is-invalid @enderror" value="{{ old('telegram') }}" placeholder="Telegram" autocomplete="telegram">
@error('telegram')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
@enderror
</span>
<input type="text" name="plan" class="form__input @error('plan') is-invalid @enderror" placeholder="Какой план вы используете?" value="{{ old('plan') }}">
@error('plan')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
@enderror
<label class="input__item"><input type="checkbox" class="input__check" ><span class="input__checkbox"></span>Я согласен с <a href="#" class="ml5 form__link"> политикой конфиденциальности</a></label>
<button type="submit" class="form__button button">Зарегистрироваться</button>
</form>
</div>
</div>
</main>