Replies: 1 comment
-
I see nothing is wrong with the core logic. Your confusion is probably about naming. If you want your users required to verify their emails, you have to implement the For a better understanding of the structure: Application's user model Example user model: <?php
namespace App\Models;
use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Foundation\Auth\User as Authenticatable;
class User extends Authenticatable implements MustVerifyEmail
{
// ...
} Under the hood, <?php
namespace Illuminate\Foundation\Auth;
use Illuminate\Auth\MustVerifyEmail;
class User
{
use MustVerifyEmail;
} Note: I deleted the unnecessary details in the core code above to make everything more precise with context. You can also check: https://laravel.com/docs/10.x/verification#model-preparation |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
The middleware called "EnsureEmailIsVerified" verifies if the user model is an instance of "MustVerifyEmail". However, it won't function properly for the "Illuminate\Foundation\Auth\User" class because it uses a trait.
Is it a bug?
Beta Was this translation helpful? Give feedback.
All reactions