Hello, friend.
Welcome back.
In a previous video, we successfully complete some of the validation right from here.
Right now, you check that validation and after that I want to do to insert this category data in our
database table so we can do that work.
In this video, I will show that things with a live example.
And as I told you, friend in there, the two different, where you can actually insert this data,
you can use that look into our you can also do that work with the query builder.
I will show you both of this way and also into the looking column to have the two different type.
You can actually use SYSOP, all the things we do with things you like, you can take it.
OK, so like first of all, I want to insert this data.
So here I have already added that our filename.
So that is our filename and that is our I have already created this method that is our method name as
Edgard method.
And if that method started from here and ended so in particular dysfunctionally that this method area
we have to work.
Right.
So first of all, it will be take that validation will still be done after that validation.
I want to insert this data.
So if you want to insert it with using that, you look at what I first of all, you have to add your
model them same name ID as I have already created or model them as a category that is a model and a
model name as a category.
Right.
So now I name it as a category.
So category model and in the category model I want to do want to insert it sound to insert.
So here I want to insert it OK.
And after that the third bracket I'm here, you have to add the semicolon and now I want to do I want
to add or all that feel OK.
I have to add that field and this field that means which area you want to insert.
So that is the category name.
So here that is our database category stable into the categories field area.
You have to add it.
So now I named our database field, so do the database field here.
I don't want to pass our requested data.
OK, that means here I have already take that request.
So this request data and that means if you go to our import field.
So from here that is that is all import file.
Right.
So that is the form here.
I want to actually pass on the required data.
That means if you go to a site or whatever the things you put on here and after that you add that at
category.
Right.
So distinguished.
So this field data, that is actually the category name.
So now I want to do I also want to take it.
So it should be decreased.
So this request, it will be displayed.
Our district is data.
These stickers will name as a category name.
Right.
And also if you want to display as a user ID, that means ensure that our user data.
So here you can also insert it.
So this user data means that you have to do that to actually create that relation.
I will show you that this letter that is or use a table into the user table to have actually that ID.
So it will be match with our this user I.D. data, OK?
That means that it will be as the foreign car.
I will discuss about that things later.
So right now I only want to do which user is already logged in.
This user ID will be safe.
OK, so if you want to save it then first of all here you have to add that our database will name our
database filename.
I named as the user ID.
I copy it.
That will be as a user ID and after that here I want to do I want to add it so it will be as our opt
or means with this logging.
User rights with the user is already logging.
So this authenticated user, that is the default on this authenticated user.
I want to access one of the field as I default.
OK, that was different.
So that is a different ID I want to take.
So automatically still be safe.
This idea that means this will be go to our user into the user.
Which user is already locked in this user.
This ID I want to take.
OK, so that's all you have to do.
So now I take it.
So that will be our authenticated user and this, that is our ID field.
And also after that I don't want to do want to add another field.
Um, if you go to our categories there is another field is created that I also want to insert that created
that data so that they are created, that I created that here.
I want to do unto itself the default on.
So you are here.
I want to use that with the carbon, OK, carbon with this carbon or so we change the date format,
which I have already discussed about the things we do.
So there is a carbon and then one of the now method.
OK, so there is a default once.
So here you have to do we have to add it and make sure you are here.
You don't need to use that.
Any semicolon.
So perfect.
So that's all you have to do friend.
OK.
So that is all in this data, so automatically notes will be inserted.
So here I use that all.
I have used that category.
So he had also had to add both of these.
That means here we have to do we have to use it.
Right.
So if you want to use it, first of all, there first of all, better I want to use our category because
I also use that our model.
So if you want to use that model so that these, you know, use and then the app and then the black
slash our models folder in front of the models folder, I want to use that category category.
Right.
That will be our category model.
That means the app and then the models and then that is your category.
Perfect.
And after that I also want to use that our let me use and then what.
I only use that all that means authenticated.
And I also want to use our carbons so that easy loana eliminate.
Eliminate.
OK, you mean Nate, you start giving you any references.
So even when it is in to illuminate and then the support or the support and then the carbon.
OK, make sure you add it so that is eliminated and the support and then the carbon.
Perfect.
So that is actually the appropriate location.
So I have to use that carbon.
I have used that all I have use that category.
So you can see that is a category used at all.
And the carbon perfect.
So now if you click the save all likelihood to save all.
Now let's check this out.
OK, so now let's check this out.
Our this look into what it is perfectly working or not.
Now go your side.
Now refresh it, see if you get any at all.
Don't worry about it.
We'll solve it, OK?
So first of all, don't take that validation.
Your validation is perfectly working the way you make it as one of the category name as a SIFIs, because
the category is not showing as a class app model.
You can see there is a folder, Mamie's mistake.
It should be as a models, not the model.
Uh, you can see the result of the models, not the model.
So here I am using as a model is still B as a model.
That means that models.
Models.
Right.
Perfect.
I believe that Savol check it again, go back, refresh it.
Uh, shaki this data and since Saturday does not know.
And now first of all, I will check that validation for getting that validation.
I add that C fiscally as the ad category.
Yes.
You can see they have no error.
That is right now it's perfectly rejected to a category at base.
And now if you go here, click as a browse.
Yes.
You can see, friend, right now I'm talking with our user is the one that means I'm walking with the
admin.
Right.
That means the Karzai, for the reasons that is clearly showing our user ID is one that is our category
name is visible and also is not created that created at Perfect.
And also if you go back and you can see right now, I am already looking with the Karzai Karzai.
If you go if you go better, I show you if you go to the profile, you can say looking with the Karzai.
So if you go to an also my email address as administrator, Gmail dot com, if you go to that, our
user in the user, you can see there's a Khasi admin that means the email as a administrational dot
com.
So user ideas are one.
So for the regions, it's actually getting that perfectly.
That means user I.D. one actually created this category.
So now I also want to do want to add another one as all categories I want to add this mean category
is the add category perfect Rousay perfectly inside that data.
And also I want to add another one, Ligas add category and Mansi template.
The add category a freshet.
Yeah the is perfect.
So here we successfully insert this data.
I hope you like it very much so.
That is one one process.
OK, that is you look into what I one process.
I also want to share with you another way that you can actually use it with using that they look into
what m so here you have to do better.
I want to make it as a comment, don't I make it as a comment out.
And also there is another way I want to show like here I take one of the variable as a category OK category
and then we have to create one of the object.
We have to create the new object.
Sorry, we have to create on the new object a new object for the category model and category model.
So I named our category model current.
And after that.
We have to do we have to win this category category, so with this category, you have to do you have
to add your all that are required to fill them.
So here with this category and to access our database, we name our database will name as a category
name.
I name it as a category name.
So you will be matched without this same as requested.
That means the requested category name.
OK, so that the things you have to do and also after that I want to do, I want to add another one.
So should be just like the same letter I copied.
So with this category I want to use that our this field as a user ID and this user idea will be just
like that same issue will be just like the same as the authenticated user I.D..
OK, so be save this part.
And also after that I want to do I want to add our Hmm.
Here.
I want to add as I get another save that I want to save this data.
So I want to add this category.
So with this category, I want to do want to save this data.
OK, so here you have to do we have to add as a safe.
Perfect.
So that is actually our another format.
OK, so with this, it's also should be inside this data.
You should be inside this hour category name.
It should be inside our user name and after that it will be saved, this data.
So now let's check this out.
Is perfectly working or not.
And that is our model as a category model.
I have also already loaded our this model.
OK.
So if you use that, you look good and then you have to actually work with this model.
So now if you click on the Save All now and want to insert it again, go back now, refresh it and now
undo and insert another one as efficiently as the add category.
Yeah, you can see it's perfectly inserted to the category.
Yes.
You can see it's not perfect means that it does data.
As a user I do want as a feature but here one things you can see here when you actually use this way,
that means that we that this format as a insert format here, you have to insert this created at here.
Right.
So here I have and manually add this field.
But we use like that we here you don't need to use that created feel automatically to be inserted that
created data.
That means you created a date and the updated ad date.
OK, so that is very much interactive.
So I will be for you to use this format.
So that is very much a professional format you can actually use.
OK, but I hear both of these Westing seems like you can actually choose it.
So right now when you insert ADC to this area, the category at.
Right.
So now I want to do I want to add this type of one on the condition when it should be said, this data
after that at category.
So still addicted to the same back and it will be displayed on the message.
So if you want to do that work right now, I want to do I want to make it as a doubt.
And also I want to open it, OK?
I want to open it.
I want to use this one because I did this first time.
So now I want to do here after this.
That is when this data will be inserted.
OK, after this here I want to do and returned and the return and then the redirect.
There is another wanted return redirect.
So with the certainty that I want to it will be redirected to the back page that Bitcoin is to be successful
in that it should be redirected to the back page.
OK.
And when you should be back, then I want to do and do so with some of the message.
So I added that with and with some of the idea in the past as a success.
OK.
So I want to add as a success and success which type of message you want to visit.
Also here, I want to do a little display at some of the masses as a category category inserted successfully
so successfully.
So they step up onto the massive Silvy display.
So that is our success and the desired it should be display the category inside it successfully.
Perfect.
So now here, if you want to display it, I want to display it with using some of the bootstrap.
Like if you go to that bootstrap official side and if you go to that component, they do the component,
they have the alert because see rejected that lot.
So now I to do want to use this type of what a lot you can use it.
So that already met gold is on here and better.
I want to use this one, OK.
This one actually.
Great.
And also they have that pause button.
So I want to copy this court and that is a copy code.
And now I want to do all the visible lead here.
OK, when we successfully done this with display, some of the masses in particular that area.
So it will go to the back page and with some of the success message.
So now go to our index base that.
That will be our best bet, right?
So here, here, that is outcomes and that is our first day.
So after this rule, OK, after this draw, that is our call eight.
So into the lead and there is another one of the call card.
So before this had occurred, before this head here, here, I want to do in the past it so that will
be our this alert alert the visible.
OK, so that will be our alert.
So here I don't want to display this one.
I removed it.
So here I want to display our this message with message.
Actually I pass it.
So here we have to do we have to add this condition.
So first of all, I want to do want to add this condition.
Eve, Eve into the session, OK, into the session.
If the station right there have any success, I'd say I have already added one of the success ID as
a success.
So that will be a success.
So if they have any success message, then it should be displayed.
This message.
And also we have to do we have to end it.
We have to end our this if condition.
That means the and if OK.
And now here I want to do want to display our this message.
So with these success that mean the station within the station area, our display, our success message.
So that will be our success message.
Perfect.
I hope and everything is very much clear to you because of all the success that I have already declared
on the message as a category instead of successfully.
Right.
So now it should be display our this message.
So now let's check this out.
If you click the save all and now refresh it.
Now, I want to do want to add as emancipation clears the add category.
Yes.
You can see it's not showing as a category inserted successfully and also there the cross, but only
if we can get across then it should be removed.
OK, so is our alert is perfectly working and better able to do that.
Is our alert on the class as the alert alert warning.
I want to make it as a success.
So that is one of the classes of success.
You can also use that danger for that.
Electing all the file.
You can use that info warning.
OK, so now that is our success message.
So for the residents here to use that success to save all and now if you refresh it again now, I want
to use that.
Hello.
Click on the ad category.
Yes.
You can see it's not perfect.
It's not showing as a category instead of successful this day.
But one of the messages visible and there is across Boston, if you can get across it to be removed
software and I hope it's very much clear to you how can insert data with using that?
You can go out and look into what I have already discussed both of this.
You can also use this one rather than you can also use this one.
Everything will be just like that.
So, you know, next video I want to do, want to insert the same data with using that in query builder.
OK, then this concept I also want to share with you, then everything will be very clear to you so
we can insert this data with using that query builder.
You know, next video, I will show that things with a live example.
So thanks for watching.
I'll see you in the next video.