Hello, friend, welcome back.
In a previous video, we successfully complete our user comment options right now from here.
If you want to put some of the comment to specific this blog post, then you can put that comment right
now in this video I want to discuss about if you want to put some of the like and the INLIKE option
for a specific this blog post.
How can do that work in this video?
I will show you that things with the live example for doing this I want to do I want to use one of the
phone, some icons.
If you want to use that font or some icon, then you have to have to add as a founder of some citizen
rights, if you go to the Google and if you start with the font of some CDN by maxilla.
And so I want to use that backslidden.
And also, if you want to use that font or some bootstrap or the W3 schools, then you can use it right
now for this cause.
I want to use that font.
Awesome.
That Maxygen, if you go to our this our link in particular, that link area, you can see that is the
link.
OK, so now I don't actually use it.
So if you want to use it, I copy it.
So that is the font of some clear link.
So I want to use this.
So if you use that font awesome.
This video link, then you can use any font or some icon in your site so that no one to turn to copy
it.
And now go to our I want to turn to add it in our template into the basics.
HTML goes into the way the stimuli have already added our bootstrap CDN Sears's.
Right.
So in particular, that position I want to do want to use it.
So first of all, I want to add that link.
If you add that link as a link and it tells you that here in our Haiti video posted on the past, our
founders Obsidian.
So that is our Maximilien.
Right.
So first of all, make sure you add it so now you can access and we found the some icon in your project.
So for the business right now, I'm just going to save all and now want to do all the visible, some
of the font, some icon.
And I want to use it in our digital space.
That means in our blog.
And if you go to that blog, blog details and here that is our comment option.
So better.
That is our blog details that there is our blog, Titos Dev.
So after this.
OK, so here after this, I don't actually use it.
That means that will be visible.
That will be visible after this hour.
Contain after this.
Now, the visible visibility on here.
So better on the deck of the H.R..
That means one of the H.R. hearings.
And then I want to do want to use our font or something.
So here I want to add all the riffling and the riffling area and put our phone to some links.
If you already know about the Fondacaro, some if you go to that Fondo, some official site and they
have so many icons.
So if you want to use it, like I use as one of the font awesome icon link I put on the class, so I
want to put on the class as a file and then FIFA, I want to use that Tumblr of Dyken tumbles and then
the all OK, get balls or and then I want to do and that is actually one of the font, some of the icon
class and I want to use that as an app.
OK, I want to make that as an app.
And also here I want to do better like here if you're not going to save all like first of all, I want
to check it.
That is appropriate or dispositional not click the refresh.
Yes.
You can see so perfectly and display.
So that is our HHR and then our founders, some icon.
So no one should be trying to make that a little bit, a little bit bigger size.
So if you want to make is that means are far into the fire I want to make as a 2x.
OK, it should be then a little bit big size click is a save all and now if you refresh it.
Yeah.
Because it's perfect.
And also I want to use another for Tumblr for the down but here that is our one and I want to take another
one.
I take another one and that will be, that will be as far far not the app.
I want to make that as a down.
So, so I don't know if you click on the save all and now if you refresh it.
Yeah.
You can see that is our thumbs up and thumbs down.
So here it not should be displayed like the toy here.
I only want to do when this user will be like this because then it should be as a like then it automatically
should be going down.
That means that thumbs down and when you click select the thumbs down, then automatically it will be
updated with our another icon at the thumbs up.
If you want to do that work, we have to do we have to create some of the function for this.
So right now, we don't need this.
I want to do I want to put some of the function I am to put some the function in our view, that means
in our blog and there is our view.
OK, and also, you know, if we go to that old model into the model, I have already created one of
the class that is all likes class.
Right.
So we dislike the design, as I told you.
There is a blog I have already created that relation with the blog class and also the user class that
benzoate user like which blog posts for the reasons here.
I have already declared both of this and I want to do want to create that our function that you details
that interview page and hear after this, after this and want to create you have to create actually
two functional one is for the like, another is for the unlike.
Right.
So now, first of all, I want to create the function and name it as a function.
And I just named that as a Leicht.
OK, name it just like I needed to like the idea.
We have to have to pass that request.
And also here we have to pass on the idea because of all this blog post aspecific this blog post that
helps out the idea.
Right.
If you go to our database into the database idea, if you go to our home, if you go to that blog and
if you put your calls, ecosystems as a nine idee is not as a six idee, and that is a one 180.
So here we have to find out a specific one of the ideas blog post.
Right.
So which blog post you actually putting that as a like or dislike?
So someone for the results here?
We have to do we have to also pass another parameter as if our ideas are right now and make it as a
pick it up is the primary key.
OK, primary kidi our database table as they have the following of the ID.
So I on deposit with the piqué, that means the primary key.
So now I want to do, I want to add our first of all I want to get all the data from our block.
That means that is our I want to get that specific, this blog data.
So we want to get it.
I have already Lord if you go you can say I have already improved our block plus the common class and
the like class.
So now we can actually use it so on to do to use it on here.
So will be first if I take one of the variable as a block and it'll be just like the same before.
So that is our block class and from the block class I want to get all that our objects that the right
objects and to get it and when and when they will begin.
That means our database that have one of the field name as a primary key issue will be matched with
our distinguished primary key.
Right.
So that will be our match with our distinguished primary key when it should be match.
I also wanted one to get that our user.
That means our current user.
So for the reasons I take one of the variable as it user and I only want to get our current user.
So if you want to get the current user, as I told you before, that will be as a request user that
this which user is right now already logged in.
So that is right now I'm logging with The Guardian and also I want to do like this one.
This one I want to make.
That means if you want to access our this method and then first of all, you have to do have to make
that as a request, that means a logging request.
So here I have already improved our logging request and I want to do and actually use it.
That means I have already discussed about the things we do.
I think you already know about it.
There is another function as a logging vehicle.
So right now, if you want to access our this logging, that means if you want to update any like or
dislike, first of all, you have to logging.
So without logging, we cannot afford that post as a like or dislike.
Right.
So I make that as a logging vehicle and then I get our current user, which user is already logging.
And now I want to do I want to filter it.
So if you want to filter it, I take one of the variable as it already already underscore anonymity.
They already like like I already like one of the variable and now with our likes model, that means
I name it.
If you go to a model that is a like smart aleck that is like.
So now with this like I want to do, I want to actually matched that.
I want to filter it.
So first of all, I want to get all that our object's data, all that our object's data and now want
to filter filter means, as I told a friend, it would be actually such OK, it will be sorted.
That means useful.
Besides our which user actually like our Hewish block.
Right.
So, so besotted.
So for the reasons I make it our objects and filter and with this filter I want to start out which block
that is our block.
Our block will be our block.
That means here that is our block.
Cell block will be our at this block I pass it.
And also here we have to do we have to also add our user.
That means there is also another user.
I make our one of the four and use that user.
So this user.
So this user will be our current user.
Right.
So our current user, I have already get the data with this variable.
So no, I just simply pass it.
I hope it's very clear to your friend.
So that block actually our D block in our model is the model that is our block.
So with this block we get our all the data.
No specific idea that I get it and then I take it with this variable, right, so now it's still match
and also our user, that means our model and the model that is our user.
Which user?
That will be our requested user.
That is the logging user.
So this current user, I take it with this variable and we also match, I hope it's very much clear
to you.
And after that, I want to do a report on the condition that if this already not like, OK, that means
if this user already not like this post, then what exactly is shall we do so here?
I make that things with our if condition.
If not, I take it.
And that means our blog and the user, I take it with this variable, if it's already not like then
what exactly should we do?
So then it should be updated that our post again that means the Leicht.
I take another variable as a like underscore post or whatever he wants to make that it's totally up
to you.
I take one of the variable of the like post and with this like boils down to do with all like that is
with the like plus I want to do and to make our sem I should be also check it with our blog will be
as a blog and our user will be our user.
Right.
So I make that things on here and after that I don't want to save all this data.
That means our dislike pulls data, this variable data and to save it I simply save it on here.
And when we say where exactly to be like that, it will be redirected to our SEM.
I shall be redirected to our same base.
That means here I have declared the same thing.
So you can see it should be addicted to our blog and then blog details space.
That means it should be rejected.
Like if you put any comments on after that comments, what exactly.
If you can get a comment and then you can see it's still redacted to our same page, that blog Little
Space and then the resource slack.
Right.
So here we did that work before for the comments of the comments when it should be done, that pissoir
should be saved, then it should be rejected to our written and then EDP response to that and the reverse.
It should be redacted to our blog details page.
And also at the have of the key argument, that means that these our blog details space.
And they have also the key argument as it's like.
Right.
So you can see there is a CLARKIE argument as Aslak.
So you should be just like that then.
You should be just like the better.
I copy it.
That means here here will be our direct to our particular database.
OK, and that between I like will be saved then it should be returned.
Our EDP response sedrick and then the reverse is redacted to our blog details with our key argument.
I pass our select software that I hope is very much clear to you.
So if you want to like it automatically to to our blog title space we dislike right.
For the reasons here, we have to also pass it.
So now I want to do and to create another function for the unlike like so now I take another one and
then name it.
I'm unlike OK, it will be as unlike and also it shall be as a logging record, I name it as a logging
vehicle and that will be as unlike also here we have to pass that request.
It'll be the same concept.
Also here we have to pass on the idea that that means a blockbuster idea.
So first of all, I want to do want to add some things.
They I want the variable as a blog and from our block class model.
I don't want to get all the other objects that are all that are objects that I want to get it from here.
Should we check our database idea with the Matute?
We will be matched with our these requested ID.
I name it as a picture to look at.
That is our primary key and also we have to get our user.
That means our current user, current user in our request.
That means our biggest user will be our current user.
Redfearn, I hope, is very much clear to you.
And after that I take them as they are already like already like this step up one of the variable and
now with our likes model, that means with our lives model.
I want to do want to get object here.
Also we have to filter it.
So I want to do in the filter and filter it with our SIM.
That means this user with block after block will be the same as a block and also our user will be our
current user.
Right now I think that our current user with this variable life simply pass it perfect.
But here it will be a little bit different before I save this data.
That means here I save our life post data.
So right now I want to do in this user will be I like it automatically or previous one that is our previous
record will be deleted.
OK, so here I want to do and to make that hour and it doesn't matter as a direct that means we are
already with our already liked here.
I want to do under the.
Like, did I call or delete my thoughts, that will be as a direct.
OK, so this will be deleted from here and after that, which will be redacted to our SIM, I shall
be rejected or same pace.
That means that we Tandi direct, but I copy it.
And now after that, after that, it'll be definitely direct to our same page.
That means one or two bits out, like there needs to be direct to our SIM as a blog detail space with
all of the key argument I just like.
Right.
So now it's perfect.
So now we have to do we have to create a tool.
This is all we have to create.
12 this year, all for one of the four our like, and that is for our unlike some better friend.
I want to continue this process.
You know, next video, I will show that things with the live example.
So thanks for watching.
I will see you the next video.