Sistema de controles da União de Ciclistas do Brasil
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
 
 
 

50 lines
1.1 KiB

<?php
namespace App\Http\Livewire\Auth;
use App\Providers\RouteServiceProvider;
use App\User;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Hash;
use Livewire\Component;
class Register extends Component
{
/** @var string */
public $name = '';
/** @var string */
public $email = '';
/** @var string */
public $password = '';
/** @var string */
public $passwordConfirmation = '';
public function register()
{
$this->validate([
'name' => ['required'],
'email' => ['required', 'email', 'unique:users'],
'password' => ['required', 'min:8', 'same:passwordConfirmation'],
]);
$user = User::create([
'email' => $this->email,
'name' => $this->name,
'password' => Hash::make($this->password),
]);
$user->sendEmailVerificationNotification();
Auth::login($user, true);
redirect(route('home'));
}
public function render()
{
return view('livewire.auth.register');
}
}