Email verification working.
This commit is contained in:
parent
c84d226603
commit
5e9f7f3359
|
|
@ -2,12 +2,13 @@
|
||||||
|
|
||||||
namespace App\Models;
|
namespace App\Models;
|
||||||
|
|
||||||
// use Illuminate\Contracts\Auth\MustVerifyEmail;
|
|
||||||
|
use Illuminate\Contracts\Auth\MustVerifyEmail;
|
||||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||||
use Illuminate\Notifications\Notifiable;
|
use Illuminate\Notifications\Notifiable;
|
||||||
|
|
||||||
class User extends Authenticatable
|
class User extends Authenticatable implements MustVerifyEmail
|
||||||
{
|
{
|
||||||
use HasFactory, Notifiable;
|
use HasFactory, Notifiable;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -58,5 +58,9 @@ class FortifyServiceProvider extends ServiceProvider
|
||||||
Fortify::resetPasswordView(function (Request $request) {
|
Fortify::resetPasswordView(function (Request $request) {
|
||||||
return view('auth.reset-password', ['request' => $request]);
|
return view('auth.reset-password', ['request' => $request]);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Fortify::verifyEmailView(function () {
|
||||||
|
return view('auth.verify-email');
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -73,7 +73,7 @@ return [
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
'home' => '/',
|
'home' => '/dashboard',
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|
@ -146,7 +146,7 @@ return [
|
||||||
'features' => [
|
'features' => [
|
||||||
Features::registration(),
|
Features::registration(),
|
||||||
Features::resetPasswords(),
|
Features::resetPasswords(),
|
||||||
// Features::emailVerification(),
|
Features::emailVerification(),
|
||||||
Features::updateProfileInformation(),
|
Features::updateProfileInformation(),
|
||||||
Features::updatePasswords(),
|
Features::updatePasswords(),
|
||||||
// Features::twoFactorAuthentication([
|
// Features::twoFactorAuthentication([
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,43 @@
|
||||||
|
<x-layout.guest>
|
||||||
|
<x-slot:heading>Verify Email</x-slot:heading>
|
||||||
|
@if ($errors->any())
|
||||||
|
<div>
|
||||||
|
<div>Something went wrong!</div>
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
@foreach($errors->all() as $error)
|
||||||
|
<li>{{ $error }}</li>
|
||||||
|
@endforeach
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
<div class="mt-10 sm:mx-auto sm:w-full sm:max-w-[480px]">
|
||||||
|
<div class="bg-white px-6 py-12 shadow sm:rounded-lg sm:px-12">
|
||||||
|
Thanks for signing up! Before getting started, could you verify your email address by clicking on the link we just emailed to you?
|
||||||
|
If you didn't receive the email, we will gladly send you another.
|
||||||
|
|
||||||
|
@if(session('status') == 'verification-link-sent')
|
||||||
|
<div class="text-green-600">
|
||||||
|
A new verification link has been sent to the email address you provided during registration.
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
<div class="mt-4 flex items-center justify-between">
|
||||||
|
<form method="POST" action="{{ route('verification.send') }}">
|
||||||
|
@csrf
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<x-auth.form-button>Resend Verification Email</x-auth.form-button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<form method="POST" action="{{ route('logout') }}">
|
||||||
|
@csrf
|
||||||
|
|
||||||
|
<x-auth.form-button>Logout</x-auth.form-button>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</x-layout.guest>
|
||||||
|
|
@ -5,3 +5,7 @@ use Illuminate\Support\Facades\Route;
|
||||||
Route::get('/', function () {
|
Route::get('/', function () {
|
||||||
return view('welcome');
|
return view('welcome');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Route::get('/dashboard', function () {
|
||||||
|
return view('welcome');
|
||||||
|
})->middleware('auth', 'verified');
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue