Skip to content
Advertisement

Customize email_verified_at column in laravel

I am currently working on a laravel project that needs to send a verification email. I successfully send an email but when I try to verify the email by clicking “Verify email address” button in the email it shows me the error unknown column "email_verified_at". I don’t have rights to add or edit fields in the database. I am just wondering where can I change this field to something else? like instead of email_verified_at I’ll use emailVerifiedAt

Advertisement

Answer

If you have changed the email_verified_at column name to something else you can try this

By default laravel User model extends IlluminateFoundationAuthUser and this class is using a trait named IlluminateAuthMustVerifyEmail which contains all the logic for verifying email address. So you can override the methods of trait inside User Model

Inside the User.php model

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement