Laravel User Email Change: How To Verify Again?

preview_player
Показать описание
There's a function in Laravel called Email Verification. But what to do if the user changes the email in their profile?

Links mentioned in this video:

- - - - -
Support the channel by checking out my products:

- - - - -
Other places to follow:
Рекомендации по теме
Комментарии
Автор

I think is best to add a secondary email first and waits confirmation for that. Then, allow the option to set the secondary to primary (and option to exclude the secondary email).

o_lobato
Автор

I don't update email until user click the verification button on email. Benefit of this is user can access the website with his old email (not changed yet), when user checks his email that says "this is an email for changing your email address..." and click it, then users email will be change.

the-fmk
Автор

I think you can use $user->isDirty("email") or $user->wasChanged("email") to verify the email is or was changed before or after save().

andrexp
Автор

I made it this way: Send verification mail on a new email; and f the user verifies a new email then update it in the user model. In case he does not confirm it all stays the same as before that.

stojankukrika
Автор

I think on the temp screen with buttons "Resend Verification" and "Logout" we need to output new email address for user to see if it's right and also add another button "Change email" or "Cancel change" in case the user has provided wrong email or had a typo in it.

VadimBesedin
Автор

hi!,
can you describe what the use of query "signature" in the verification url? Cause laravel only use the hash query to match the user email.
Ref:

MDLimon-jhyq
Автор

I don't do it like this, because this is quite dangerous. If the user made a mistake while typing the email address, he/she forever locked out from the system instead I use package. I think you done a video for that package while ago.

smith
Автор

You can't do it in this way, because if the user enters a wrong mail the user ist locked out from your application.

janfornication
Автор

Hi, Povilas, Please share your opinion about any request validation open source repository. Which can resolve Price, date of birth, password etc. Validation issues.

AhsanKhan
Автор

I think the best solution does not make ANY changes to the user's email unless the verification is completed.
Profile update requests get the email stripped out of the update data that updates the model. If the email address is different from the stored value, send a notification to the new address with the a link to perform the action. The link contains the user ID (uuid in this case), an encrypted version of the new email address and is signed (expires in one hour). The app (controller/model/service) then decrypts the new email address from the route parameter and updates the database. If you want to update the email verified at date, use the function markEmailAsVerified().
Note: User is logged in so we have to trust the user making the request is the actual user.

makerdave
Автор

Hello! I want logged in users to change their name, email, password, address, phone and image. I'm using Laravel ui/auth package to register users. How can i acheive this? Any guidence please.
Give me solution as I'm stuck at this point.

jawadahmad
Автор

1. alaways re-verify if your business logick require working email like transactionals confirmation etc in webshop or confirmation for orders or similar.
2. method is ok but bether i think is validation dns if user used email like order somethink in shop and you need send email to user with details of transaction or coupon code for delivery, or access to new vps etc. businel logick. But not only if user change email, if use...

marcincook
Автор

Would rather stick this into the User model with on "updating" and check old and new value there.

seppdaniel
Автор

I want to send Email OTP instead of verification link. Does anyone have any package suggestions for Email OTP sending and verification process?

SouravTah
Автор

sir, would you mind to change your github to dark mode please, much more comfortable on our eyes it would be awesome, thank you

hosamgnaba
Автор

Hello Laravel Dailly,
Out of context but I followed this tutorial you did 2 years ago,
For example, the total is 300 so when you make the first form with quantity 100, the 300 should be subtracted on the fly to prevent users from entering more than the total quantity,
So my question is how do you capture the update of quantity on the fly. Or better suggest how I can implement that.

ngetichishmael
Автор

I've used the to accomplish this wihtout many hassle 😄, it could be nice for a package preview/showcase here.

REJack
Автор

hi i have questions is there any way to print from web server to local printer 🖨️ !? by laravel

AhmedMohammed-voif