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).
@redayoub2 жыл бұрын
+1
@the-fmk2 жыл бұрын
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.
@andrexp27582 жыл бұрын
I think you can use $user->isDirty("email") or $user->wasChanged("email") to verify the email is or was changed before or after save().
@Appelkoekie2 жыл бұрын
Correct
@stojankukrika72422 жыл бұрын
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.
@Appelkoekie2 жыл бұрын
I wanted to comment this approach, because if the user made a typo error in the email, he would lose access to his/her account. So +1 😉
@stojankukrika72422 жыл бұрын
@@Appelkoekie yes,that iz correct. Tnx 😉
@pamaju2 жыл бұрын
I think it's a good idea. That way you avoid the typing error and the possibility that the account has been hacked and they want to change the email. The problem (as always) is how far one takes these scenarios, think that if the user lost access to his email and therefore wants to modify it in your app, he will never be able to do it
@stojankukrika72422 жыл бұрын
@@pamaju he can chage it in valid one because real user mail stay the same,on email verification it will be updated.
@pamaju2 жыл бұрын
@@stojankukrika7242 I had read wrong, you are right!
@MDLimon-jh8yq8 ай бұрын
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: Illuminate\Foundation\Auth\EmailVerificationRequest
@VadimBesedin2 жыл бұрын
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.
@Appelkoekie2 жыл бұрын
See Stojan Kukrika's comment for an even better solution.
@smith45912 жыл бұрын
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 protonemedia/laravel-verify-new-email package. I think you done a video for that package while ago.
@saydfuad69142 жыл бұрын
This was my concern too
@travholt2 жыл бұрын
Yeah, I couldn't stop thinking about that too. And I know from experience that many users suck at either remembering or typing their e-mail addresses correctly.
@umarbabajidda96642 жыл бұрын
Very thoughtful - this never even crossed my mind. So do you keep the new email in a temporary field or something?
@jacobtims5692 жыл бұрын
Never thought about it that way. I'm going to use that package 👍
@maou8422 жыл бұрын
It makes sense.
@AhsanKhan892 жыл бұрын
Hi, Povilas, Please share your opinion about any request validation open source repository. Which can resolve Price, date of birth, password etc. Validation issues.
@Appelkoekie2 жыл бұрын
DoB is just date validation which is an existing rule in Laravel. Password validation is easily done with regex, just give it a quick google, the format depends on your app its needs. Price is easily done by modifying the user input to a float (or int multiplied by 100) value and just validate on that. Don't throw errors to the user for wrong input which you can fix easily programmatically. For example: if they input "€ 10,25" or "€10.25", just convert it to float 10.25 or int 1025 before sending it to the validator.
@vitalii11302 жыл бұрын
@@Appelkoekie Never Use Floats for Money! Only integer or decimal type
@Appelkoekie2 жыл бұрын
@@vitalii1130 i was talking about php data types, not sql data types, and you can perfectly use float values for money in php, only you should round it to 2 decimals after operations.
@vitalii11302 жыл бұрын
@@Appelkoekie using integers is much better, no need to mess with round everythere in code)
@Appelkoekie2 жыл бұрын
@@vitalii1130 its not better , cause then you need to mess while calculating numbers as well. Integers is only "better" when storing in database.
@jawadahmad81982 жыл бұрын
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.
@janfornication2 жыл бұрын
You can't do it in this way, because if the user enters a wrong mail the user ist locked out from your application.
@janfornication2 жыл бұрын
I would send the mail first and when the user hit the link in the mail, than i would switched the email on user model without "hard" reverification
@SouravTah2 жыл бұрын
I want to send Email OTP instead of verification link. Does anyone have any package suggestions for Email OTP sending and verification process?
@makerdave422 жыл бұрын
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.
@marcincook2 жыл бұрын
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...
@seppdaniel2 жыл бұрын
Would rather stick this into the User model with on "updating" and check old and new value there.
@hosamgnaba32052 жыл бұрын
sir, would you mind to change your github to dark mode please, much more comfortable on our eyes it would be awesome, thank you
@LaravelDaily2 жыл бұрын
Sorry for me personally it would be uncomfortable, I don't work at night.
@Appelkoekie2 жыл бұрын
@@LaravelDaily I always work on dark mode, also during the day in a bright environment, not only at night. At the end of the day my eyes feel less tired.
@ngetichishmael2 жыл бұрын
Hello Laravel Dailly, Out of context but I followed this tutorial you did 2 years ago, kzbin.info/www/bejne/n6asdqSFmLacbMk, I followed it successfully and implemented it in my project but my project needs to track quantity and subtract from the total. 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.
@LaravelDaily2 жыл бұрын
Sorry I don't remember such old tutorials by heart what I did in that video 2 years ago.
@DevduttaBain2 жыл бұрын
You must bring max quantity for each product with the product list. and check it on every possible quantity update method. I guess.
@AhmedMohammed-vo5if2 жыл бұрын
hi i have questions is there any way to print from web server to local printer 🖨️ !? by laravel
@REJack892 жыл бұрын
I've used the "protonemedia/laravel-verify-new-email"-package to accomplish this wihtout many hassle 😄, it could be nice for a package preview/showcase here.