Skip to content

Commit c645b67

Browse files
committed
Enabled Email Verification
1 parent 66042e4 commit c645b67

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

app/Models/User.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@
22

33
namespace App\Models;
44

5+
use Illuminate\Contracts\Auth\MustVerifyEmail;
56
use Illuminate\Database\Eloquent\Factories\HasFactory;
67
use Illuminate\Foundation\Auth\User as Authenticatable;
78
use Illuminate\Notifications\Notifiable;
89
use Laravel\Sanctum\HasApiTokens;
910
use Spatie\Permission\Traits\HasRoles;
1011

11-
class User extends Authenticatable
12+
class User extends Authenticatable implements MustVerifyEmail
1213
{
1314
use HasApiTokens, HasFactory, Notifiable, HasRoles;
1415

routes/admin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Route::group([
44
'namespace' => 'App\Http\Controllers\Admin',
55
'prefix' => 'admin',
6-
'middleware' => ['auth'],
6+
'middleware' => ['auth', 'verified'],
77
], function () {
88
Route::resource('user', 'UserController');
99
Route::resource('role', 'RoleController');

routes/web.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@
1919

2020
Route::get('/dashboard', function () {
2121
return view('dashboard');
22-
})->middleware(['auth'])->name('dashboard');
22+
})->middleware(['auth', 'verified'])->name('dashboard');
2323

2424
require __DIR__.'/auth.php';

0 commit comments

Comments
 (0)