Hello, friend, welcome back.
In a previous video I have created on the farm and at the farm area, I have visited one of the loud
right I have played on the ground as a password update seed the Webroot area.
I have created one that is a cloud.
You are, and that is our name as a password update.
And then in our changed password, I have created one of the Methode as an update password and that
is also as a post method.
Right.
So now I have created this.
Our map put us up password in our changed password controller today, doctrine's password controller,
and that is our method.
So as I told you a lot of the time.
So when you use that post, then what exactly you have to do here?
We have to add that as a request.
Right.
So now make sure you add it as a request.
So request will be as a dollar request.
So the request will be at the request, right, and after that, first of all, I want to do I want
to ask some of the validation.
OK, so if you want to add some of the validation, then what exactly you have to do?
I hope you already remember that part.
So that will be as validation that the validated data validated.
And that's one of the variables.
And then with this request, so with this request here, I want to add that validated my thought.
So that is our validated method.
Right.
So make sure we added.
So now to do and to add some of the validation.
So here I want to add some of the validation.
So I want to add some of the validation for our field.
So I have already put that name to name as an old password.
So all Ponsoldt feel I want to make it as a record.
So here that will be our old password.
It the single code and here that will be our all password.
I don't want to make it.
It will be as a record.
OK, that will be as a record.
And also we have to do what we have to match our password and the password that this new password and
password should be the match.
So if you want to match it.
So that is our filename, as I name it, as a password.
And there is our passports and I copy it.
So that will be our filename as a password and password should be as a good record.
And also I want to learn to make it as a confirmed.
So that will be as a contract.
That means with this automatically, shall we take our password and the password is match or not.
OK, so here I am of the validation and after that I don't have to do I have to actually like for this
user.
So right now, this user already logged in.
Right.
So this user already have one of the password and this password is on the hash password.
So I want to do I want to take one of the variable.
I take one of the variable of the hashed hash password and ask password will be our authenticated user.
That means which user is already logged in.
Right.
So this authenticated user.
So this authenticated user, I want to learn to get our field, our field, which field?
I want to get our database field as a D password so that our password field I added.
OK, so after that what exactly we have to do.
So if this user already have the password that means here, if this user put that password, we have
to do have to match it in our this password area.
So here I want to do I want to add the if condition.
OK, and B, I don't know the if condition and the if condition is will be as a first of all.
First of all it will be check it with the Laravel default authentication that into the default authentication
that have also one of the function is hash.
So with this hash I want to do and check it so that the default code, you have to remember that part.
So that is our check.
And with this check, I want to do want to check it with our distinguished producer.
That means one of the things actually pass from this request to the user from this field.
So here we have to add it.
So here our request.
That means with this request, with this request, I want to add our filename.
So that is our fields or filename.
I have already put that filename.
If you go to what Jane's password or filename is this one as an old password.
Right.
So it will be ticket.
So that will be our old password and all password will be what all password will be our Ts authenticated
user.
That means which user is already logged in this user password.
Right.
So this is a password.
I have already take the things with this variable so easily match without this one.
I hope friend is very much clear to you.
That means one of the things you will put into the current password so each will be matched with our
these authenticated user which is already logged in this user, this password will be match.
So we need to match.
So here I take it with our D half stick.
OK, so with this hatcheck I simply take it.
And after this I want to do I want to add on that another variable as a user and with this user, I
want to use that our user model.
So here with this user model, I want to do and to find I want to find our specific authenticated idea.
That means which user idea is this one like this that is actually the user.
I don't double it.
Right.
So that is the idea.
So here we have to do we have to find out this all tidy.
That means the authenticated, user authenticated user idea.
OK, and after that, I want to do I want to create one of the new password.
So whatever the password right now, I want to create from the particular disposition.
Also, we have to do we have to create this password as it has.
Right.
So this will be saving our database.
It will be.
There has password, so for the reasons here, we have to do have to make it as a hash.
That means with this user and with this user, with this user, what are the things will be best.
So that is our field as a password field.
OK, so that is our password field.
That means I hope you understand that part.
That means this user.
What are the things you put in particular, this password field area.
It's the one you should be saving our database.
It should be saved by this password.
So far, the results here, our this password field data, I want to learn to make it as a hash password
so it will be as a hash.
OK, haves.
And I want to learn to make this password.
I want to make this password as a hash password.
So our hash password will be what our hash password will be our these requested password.
Right.
So this requested password means with this request, with this request, what are the data will pass
from our this change?
There is a request that fill our filename as a password.
Right.
So this password will be our request and password to this requested password.
I make it as the hash password and that is our user password area will be safe.
So now I to do want to save this hour user.
That means here I want to do I want to add simply user to this user data.
I want to save it.
Perfect.
So that's all you have to do.
OK, and also when this data will be saved, that means when I am I want to do when this user actually
changed their password automatically, this session will be destroyed.
It will be returned to our some of the specific ways that this user will be logout from here.
OK, so here I want to do that work for the reasons here with the simple of the code, we have to use
the auth that is the authenticated user, which user is already logged in.
So these authenticated user will be logout.
I simply add our logout method as a logout.
So that is all the default one.
So automatically when it should be saved, this data, this authenticated user will be logged out of
event.
And after that, I want to do I want to return it.
That means it will be returned.
One of the redirect redirect so it be returned to one of the road, OK, one of the routing.
It'll be returned to one of our logging out.
So that is actually follow on.
I have already discussed about the things we do with some of the message sorry with with some of the
success message.
So I have already created on the success.
Any success I saw here will be displayed as a password.
Password is changed successfully.
So this step up, one of the messages will be displayed a friend.
So make sure you added and ils.
I do want to make it as ls ls it will be a display.
I don't think so.
Carriers will display the return underpays so I copied it will be returned redirect to the backspace
and make this a backtrace.
And in the back area here, if you want to add another idea, you can add this idea so that no, it's
OK with me.
That means here you have to add another class of the arrow.
OK, you have to create another class of that or and then you can actually pull the message as a current
current password is invalid
because this type of one of the message itself will display.
OK, so that'll be option.
Perfect.
So that's all you have to do.
So now if this user actually changed this password, it's really done.
The director login page with that message login pays for the logging I have already created on the page.
If you go, that is our.
Locking pace, so I'll do that is later.
First of all, I want to check it, everything is perfectly working or not OK to save all or I didn't
complete this position at the time, so I have already put it on the locking pace.
I hope you already remember.
So that is in our in our pages.
So here that is our body.
And that is art you can see into the odd that is a logging blade, simply the logging blade, I have
already added one of the art this team template into the template that is actually our logging page.
Right.
Simply the logging page here.
I want to do on the visuals of the message.
Our message will be actually I have already created like if you go, you can see they have some of the
success message.
So there is a success message I want to visible.
OK, if they have that in section as an idea, as a success because of all from here, I have already
passed that as a success.
Right.
So now we're going to copy it.
And here we added, you know, logging.
Into the logging, and that is our logging dashboard, so here before the signing, before here and
again, the visibility on here.
OK, so better to display that message to be returned redirect to our logging base.
So what we don't seem to the logging base.
That is our success idea.
I simply had this success idy so now it should be visible if this actually successful sign out and after
the sign out automatically Silvy that means after that save automatically this user will be logged out.
And here friend one thinks I have already used some of the things I have used our art.
So we have to add that all we have to use that our hash and also here I use that user model.
So now everything we have to do, we have to use it on here.
So make sure you use it.
So first of all, I don't want to use our model.
That means that we don't use sorry, use our model that is in our app and then the models so that the
models folder and the models folder is the default model as a user.
Right.
That is our app.
And there is the models folder and the model that is the default one as a user class.
So that means user model.
So now I have to do have to add it and also here and use the user out.
So that will be as art.
And then also we have to do we have to use that our I have used another one of the hash salts we have
we have to use it has that means here on the do the use and that is you our illuminate.
OK, so that in a minute I want to use it after that illuminate and then here it will be as a support
and then the fassett.
Offensives and then the house.
OK, so make sure you add all the things that is used to model the art and then eliminate support and
the failsafes and the harsh.
Perfect, so user ordered and then hash, yeah, that's all so no, that's all you have to do.
Now, let's check this out.
If you don't click on the save all, I clicked to save all.
And now if you go here, click the refresh.
So right now, first of all, I want to check that validations here, if you put your current password
on, if you put the current password on here, if you put that inappropriate, use a new password and
the positive, the save nervous system showing that the password confirmation does not match that means
is appropriately getting our dis validation.
And also here, if you make it as empty.
That means if you make it as empty as a safe and system showing as the old password field is required,
that means it's perfectly getting our all that validation.
So here I have already had that validation.
That is all password is required and password feel is required and password should be as required.
Right.
So now it's perfectly getting all that.
Our validation isn't so right now.
I want to do I want to change it like right now if you can get a log out.
So right now for this user, that that means and here I have put the password as you do me.
One, two, three, four, five.
Click the login.
Now can see right now, I'm successfully logging, so I want to change that password, so my current
password as you do me one, two, three, four, five now and want to change it as you do me one, two,
three.
And you do me one, two, three.
OK, so now I want to change it.
So if everything OK after that it'll be returned redirect to a logging base.
Right.
So here I have already did that work.
That means if this save this data is authenticated, users will be logged out and automatically to return
redirect to our logging base.
So now let's check this out.
If everything OK, it should be work.
So now I going to save.
Yes, you can see defend now showing as a password is changed successfully, so that is the message
I have already added that is to be done.
The electoral locking page with some of the success message and the password is change successfully
for the reasons, you know, logging d'ampezzo, that is a logging company, tried to do the logging
template.
I have already add that our message, that message alerts and I can see your message are invisible.
So not wanting to do harm to logging my old password as you do me.
One, two, three, four, five.
Now let's check this out.
This perfectly does not clear the signing.
Yes.
You can see you cannot signing with our old password.
So right now I have updated as you do me one, two, three.
Now one, two and two logging with this.
You do want the three.
So, again, you do me one, two, three.
I want to log in.
Yes, you can see that means our password is now successfully updated.
OK, so right now we can actually use it.
So our password is now successfully updated.
And so here we successfully complete our D password option.
Right.
So from here right now, you can actually change the password and you can actually create your new password.
So friend here we successfully complete this part and I hope Prendes will understand about it.
So what exactly the things I did in particular that area.
So that's the code you have to do.
OK, so that is the all you have to know.
So just practice it so in the next video and to discuss about the profile.
So for this profile, this user already have the user name on the email address.
So if you want to change that email address, if you want to change that user name, how can change
it?
In our next video, I will show you that things with the live example.
So thanks for watching.
I'll see you in the next video.