Hi, friends. Welcome to Tuta Fun Channel. In our last video, we complete the course part in this video
I'm going to teach you about the batch part, batch creation, but each course has a batch
So we have to first we have to go to the batch section
right? So we have to go to the batch section. Uh So we have to create a batch section
So what you gonna do is I'm going to go to my website
So I'm going to create my uh batch, right? So my credit application
all the credit you go along with the document, she tells you to create the credit, credit operations right now
I'm going to create the batch creation. So first I'm going to start the migration fund up
It is got a copy this OK. So let's uh right, right
Let's copy this back to my project. This is my project, right
OK, please. Here, I'm gonna change this one for badges digestive
badger has been created successfully. Now, badger table has been created successfully
After that, you can go to the badger table is badger table
The blank badge table, you will be able to see right? So you have the columns
right? So what you can do is um now the badger table
we have to create the columns. So what you do is these are the columns you have to create
So let's face it here, column name ID ID, we have unsigned big integer
OK? So that's why we have to migrate, we have to set the foreign key, OK
The foreign key, this is the ID, the bad the this is a co stable id
OK? So the cost stable ID, which is a primary key, the same character key available in the badger table
which is called as a foreign key. You have to make it as make it as unsigned big integer out the start date
After that foreign key, we have set that co ID reference ID
ID is the core side. OK? This foreign key is a co id reference side is a core stable ID
The same ID, which is available at the table is called as a co side
OK? This is the relationship we have to make it. Now let's file
save all. And we have to make another simple modification. So you have to go to the configuration
config uh we have to go the database section. It's a database
OK? Here is a database uh database. We have a uh sorry
you have config we have a database for P H U five
So here we have to make simple changes here. The engine. It's defaulted commercial user of that
We have to change this, this this format. Then only the the if you are
if you make the changes on this, then only it should be work on this on li method cask
This works right now. Let's file, save all everything. Now, I'm going to make a migration
part page cards and migrate. Uh Can't
right. OK. Here, this uh this the problem here is simple error here. So here this one will be changed as save
OK? Now, let's again, we have to migrate right here. The back table has migrated successfully
Perfect. Now, here we have to make the relationship successful right now
What I'm gonna do is we have to do that. Another thing is uh we have to create that uh feet
So we have to go to the views, the view section. We have a course and uh students and teachers uh folders are there
Now, I'm going to create the select the same for uh the course folder
Now I have now I have created courses and students and teachers
these three models I have created. Now, I'm going to create a new model which is a badges
So how to create the badges model? Uh Before that, I'm going to go to the layout dot play dot P H page here
I'm going to create another URL link which is a badges. I just different badges
Mhm Right. If you, if you click on this particular link, it goes to there batches section
So let's save all and let's reload here you here. The link has been added successfully
If you click on this particular link, it go the pages. I have not link any pages so that it show us blank
After we have complete the batch model, it goes to the respective page
So let's do the batch part as well, right? So we all the migration part
we have done it. Now let's do the controller section. So let's go to the section
So let's go to the particular website which is a this side
go to the page, which is a which is a A nine
But if when you do the project, you go along with the document, it is very easy to complete the project
OK? Every time that so all the source code should be, I will be after complete this lesson
I will provide all the source code. Don't worry about that. OK
So here la my internet connection is a little bit slow. That's why it takes some time
Sorry for, sorry for the inconvenience. So let's go to my table migration part
I have completed how to make the foreign key relationship. I already uh done it
Now, I'm going to create a controller which is a batch controller
You make it as a batch controller. Go back here, copy it past it over here
You have to change this one as a batch controller, but it's a controller, batch controller present the key on your keyboard
Now, you can see the batch controller has been created successfully. Now, what I'm gonna do is a bad batch controller has been created successfully
Now, you can see the controller which says that the newly created the control
which is a batch controller. Now, I'm going to go to here
I'm going to change everything as a batch, right? So I have to do that badges control
So I'll put the batch control this work right now. What I'm going to see here we have two
she go to the post controller. Let's say everything I just copied
place it over here, only the changes the instead of the course first will make us badgers
OK? So here we we haven't created the model yet. Let me create the model of the batch
So to create bad batch model, you can take the code over here
right? You place it over here, you make it as bench when you create the model and badge
you have to understand the don't, don't create badges, OK? Only create a singular batch
OK? So OK, controller is a batch, OK? This is the camel case you can see here
this is the efficient way to write the controller. You can see the name batch
batch, batch, the B should be capital. After that you can see the C should be capital OK
This is a name in conversation, you must understand the rule while creating the
the model and controller. OK? The bad has been created successfully. That is the part where I communicate with the database
right? So what you're gonna do is here uh Let's back our
if you have a what and what are the columns you have? If you haven't confused
if you forget it, you just go to the migration part of the batch
These are the column we have created name course ID and start date
OK? Don't copy this one. This is the foreign uh foreign key relationship
OK? This is a foreign key relationship. You don't copy the right. So what you you just go to the course
you just copy this one tasting the badges. So this one of the table and badges ID
often outright this uh distinct name, I guess your name. Yeah
I will take the note pad and patient of that whole ID
After that starting date, these are the three attributes we needed right now
Let's back here. Batch you cried. Name is OK. Four side is OK
Third one should be the starting date with three attributes reading. OK
There's three column data consists of a bad team. So let's share all let's back to our badges controller
here have to mention the name space which is a for and place it over here
This one would be batch like now what I've got is the badgers
It's a badge, the badger Syntex, right? Bag, right? OK
The same thing OK. These are all things I already thought about this one. OK
We load the all the data from the batch batch database via the model
We are just communicate with the database in include and bring the data and assign the variable badges return to the index pitch
OK? That's the thing you fill over how the create page. What you what does is here as well here
Great pig vata is. Yeah good. We have to here go to the this
is written back power course. So change it as courses. That is great
Your badge but that's great. OK? We have to create a folder badges
It goes to that page to badges, create page our storage. What does this
It will be show there? It will be stored the data into the database
right? You have to understand what uh what does this all the function it will be show the data
This one should be when you click the add new button, it's goes to the uh the create form will be shown after fill the
data, click save button. It will be coming here, get to all the data and get the just here and add the data to the
data. This is this is out there working, right? So here what you're gonna do is store function
You copy this one basically over here this input here the table student
OK? With student which is student, it make us which is a batch batch create all the richest the badge rich
Just put it here to store the batch table. Return back to the which is a batch
It's a bet. Mm I come back to the match peach. OK
So batch peach you back the batch page batch. OK? How to show data
here? What I'm going to do this show later what you gonna do this here? Copy this one
They sit over here. You have to change this one as a student. You have to change this one as a as a badges
Bad bad. You have to change us badges. So badges, you saw badges
he saw badges, you should also bads. They show badges. It's a bad model after
the edit. This I don't need to uh explain anymore. We are already this is all the things we have to we have already explain
OK. By while we creating the uh while we were creating a uh uh previous controllers courses
and students and teachers, I've already explained. I don't want to explain again to waste my time
So let's copy and paste and change. Change the code, right. OK
Right. I hope you understand, understand up to now let's continue the task
Let's go to the section edit can also be change uh batches bad
be yes, they're just the batch section be
badgers, batch I
did right
now what I'm doing here, we have to. So this one should be the view
Have you store the
bill redirect
I everything. Perfect. Now what I'm going to do is let's file save
All right. Now what I'm going to do is let me create the uh page OK
One bible. Let me create it. Copy, select the views folder
paste it. This one should be badger right
now here. What I'm going to do this batch table. Your credit is for NASA batch name
OK? The batch name, batch name you are right? Batch name. Ok
so your name? Second one should be there. Course. Whose name after that duration
Uh course name, uh batch name, name and start date, start date
right? That's it. Ok. So here let's go to the name uh course name
uh course ID and course ID. Course I did a course I did
This is a start date, start date. We have to get copy the same thing, right
Got it. Ok. Now batch name, ok, it's a batch pitch. Get rid of this page
We no need them. Ok? Keep only the batch, the badges awesome badge
Ok. Now go to the respective badges page. You have to fill the form name
course name and starting date, right? Starting date. Ok. Starting date, right
Uh in uh instead of the input a field, you have to make it as a date field
That is your wish. No problem. Right after the let's go to the index page here
you have to create the badgers badgers badges, you
write a badges, creed. That's, you're
right here. Name, batch name. Second one should be the uh course
course this one should be that start it. The
badges are starting t here are two. We will be able to see here at this from the badgers
Badgers, the item, the name four ID, start date with the same
name you have given otherwise it, it, it, it won't work. So you go to the badges migration bar
the same names you have to give up. I I right. It won't work
Otherwise it loading the data from the database. If you store the data
the following names. Ok? Ok. The same names you have to give, then only the data will be short on the index
Otherwise it, it click take from, OK. If you are giving different names here
uh the the database uh column also, the name should be different
The data is not display. OK? You have two. Uh you have to check
double check with the sticks, right? Perfect. Right. Now here we are like this one is a bad guess
but I guess you very magistrate. It's a bad. That's
the thing here. I'm good. It's fine to see you on read section badges
but just bag ID, bagger name, badger, badgers
starting start date, you
are given the name, that's it. We've done the things right now
Let file save all. Now let's back to the end of the page is a show page here
Also, we have like a all thing you make as this on the batch page
get rid of the badger open badges. But uh this one could be changed as a badges name
This was the course ID. This one should be the star. Let's
find save on back dot uh project and check it whether it's working fine or not
Uh Let's refresh them badges. All right, the problem is we haven't created routes
So if you, if you, if you have get this following problem uh 404
you get the idea. You haven't created ro ro section. You have to give the
you have to get the part when the is coming, the badges is close to the badge controller
badge controller. You have to tell them the path where your batch controller resided on your project
You are given the path properly. You have to create the path batch controller file and save all and bring it back to your application
and refresh it again. Here, your batch table is loaded successfully. Now
I'm going to add the batch click new. Uh Here you have to create a uh batch where let's go to the database and check
it by squad because the first name we have to uh load
from the combo box. Ok. Now, in my next tutorial, I will be teach you the features
Ok? Now at the moment, you have to create the, we are given the ID courses which are are the courses available
and all the things we have to, we have uh OK. I'm going first before the create the batch
we have to create the courses, right? So we have courses, I'm going to create a new courses
So Java syllabus, we have got ABC, we have to uh syllabus months
So all things I will show you how to be no need to type the month
how to generate the code. All the things I teach in my next video you got don't to read right now
The the course has been created. So let's check the database. The CO ID has been one now the C ID we have right now
Let's chat that this is the cost and we have to add the batch also. So you have to go to the badgers
I'm going to pay the badges. So badges also we have a straight edit and all of that here
Also the badgers badges you are right. Let's do things and
fresh it. Click batch. First name is a Java batch name 0003
first name one mean here the Java which is a primary ID one here
You will be able to select the course in I in my next video, I'll show you put one drop down and you will be
able to select the course what you fi right? What is the course you have to uh put the batch
OK? Here the batch number three, Java three here, select the course is Java
right? The Java course name is one here in the next video. I'll put the dropdown on
Yes, you will be able to set the course names over here. Right. Starting date
Also next video, I'll put it to one uh date, date, pick two
OK. So we have six month, 2043 hit save button, save button
Uh The four sided alert, the core side doesn't have a default field
If you get the following error here, you can see the insert statement that I er OK
So here's the name. Uh So the field value is not displayed
That's why it will be telling the errors. Uh field column I does doesn't have a default value
So what you do is you might not have to go to create page that just create page
So you have to double check if this name is correct here. The name name
this is a name also, you have to make it as a coside. It's a name which will be we will be goes to the
controller page's name, the co side, the start date here also start here to name it
start date. But if you haven't made the changes, that's the problem. Let's save all and back it here
And let's do the batch. Create a new badge, Java 0001 to
side one data will be selected like this. The three six month plan
Uh, here it's a badge. Ok. So it's, it's working. I will be able to see here it goes
Here, it's working here. It's working, right. It's working. Now, what I'm gonna do is here
I'm going to the redirect page is the wrong uh redirect page has the bad
So 32 are stored data is related to batches cliff
badges. Ok. Now let's back here for the badges. It, it be successful
OK? Now let's do the uh edit part as the other badges is not bad
Edit is badgers. So for to save all, now let's add the data if
we want to make this uh page. So we want to make the changes. Changes also must uh changes
batch name name or things like this one would be the uh ID
So all things are ID I DS name. This one should be the course ID starting date
We apply this name. This one should be the course course your would be dead started
She had to write a star. You have to make the that two update
If you want to view the records, you will be able to view the record for a fine and we will also be able to
change this modification for the view page. Also also you have to change this address
This one will be the course this is of the start date I
say bring them back to our application and check it. Yeah, it's working from del the record click period
That what I has been perfect. It's working perfectly well. We have compared the batch part successfully
Well, in my next video tutor, we will go there and go. But thank you for watching