RegisterController
Contrôleur par défaut disponible dans Auth\RegisterController. Facilite grandement l'inscription de nouveaux utilisateurs.
// Page d'inscription
Route::get('/register', 'Auth\RegisterController@showRegistrationForm')->name('register');
// Destination du formulaire d'inscription
Route::post('/register', 'Auth\RegisterController@register');<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Inscription</title>
</head>
<body>
@if($errors->any())
<h4>{{$errors->first()}}</h4>
@endif
<form action="/register" method="post">
@csrf
<input type="text" name="name" id="name" value="{{ old('name') }}" placeholder="Nom...">
<input type="email" name="email" id="email" value="{{ old('email') }}" placeholder="Email...">
<input type="password" name="password" id="password" placeholder="Mot de passe...">
<input type="password" name="password_confirmation" id="password_confirmation" placeholder="Confirmation du mot de passe...">
<input type="submit" value="S'inscrire">
</form>
</body>
</html>Last updated