April 8, 2020
#8 LaraShop || Create Categories || E-commerce website in Laravel 5.5 tutorial

#8 LaraShop || Create Categories || E-commerce website in Laravel 5.5 tutorial


okay friends in this video we will
complete our category scenario first of all we will create a table for my signal
table for categories then we will create model and implement our code in blade
same like our products on the right side we will display category which is that
is exist in our my second table and left side we will create a column to add a
new category so first of all go through a terminal or CMD CD to your product and
here you will say PHP artisan make migration migration name create yes
paper you can name it anything it will play it in my second table name for yes
okay migration is complete go to use your database directory and the last you
will see here is your category table add column as you mark I am adding a string
string for their cat and cat name her name is Katniss save it go to those back
to terminus yes PHP artisan migrate it will create my sequel table that spring
does sorry is spelling mistake this pink now if if I run PHP artisan migrate it
will complete my secret even in PHP myadmin
okay it’s migrated go to your browser up on my signal table your database inside
you will see cache table here is your cats now I will insert a dummy data for
two categories anything you can add here I am adding get one cat cycle thus forth
our demo purpose scatman yet again here is something put any value no matter
what is that value this copy is because we are the same time food share go now
you have a two categories okay so now go to the back to terminal career for this
PHP artisan make water cats model is correct successfully got will your
editor close migration file open app folder and you can see here is cats okay
here is nothing you can keep it empty for now but here you will a first of all
we need a blade for add category we are will display this interface same like we
run our aircraft so for now I can copy this okay so go to resources view admin
folder add category blade save as simply cattle okay you can change if you much
to change for now I just change it heading
later we will change it as movie parts everything okay you can keep it now here
routes mule if someone click on category add category then it will show admin dot
add calories simply this one okay let me kick yes gained it every
okay sorry it is not found why this not my figure
out net category at you mean dirt ok here is mistake three fresh now you have
a blade for air category but data is products so we will figure out go to
your products table here is I mean played here is the table for products
that we will save it save as for cats simply you can put here cats cats
anything name it okay here change it yes just count okay
category cable does not have price code so we will make it category name and yeah chains follow me
that’s all for now just close this hmm inside your web do PHP make a route
route for this type of route we were grateful same for a work elegance and
its new cats if somewhere click on cats it will this plate yes bit down here like a table data with Eric F your model
names gets older everything contained in data and pass in
your cache blade okay just in fresh or nothing in here
I am checking and this gets now you can see it’s get we want to this player just
go to here and edible plate and yes you can see admins nests for truckers we get
cats we load now you can see is your category table on your right head
okay now change it to make the upload the file let me show you this is
changing every time let me see without any regret
here is one okay now I will change this form according to this column name and
we will insert when that okay go to your plate let me clean the view of Adam okay
first of all we don’t need anything we need only cadmium and get name
variable button same message same token same and you don’t need this typos okay
delete it is Jane the variable name according to your bicycle people and we
will get it and our internal so here is you need to change it saved Catholics to
insert pass the data to your controller okay here get that Molly has been
inserted you can say created test nice okay after this change the view you
don’t need any text boxes okay this excerpt X boxes we will delete here you
would put category name is it get me that’s all okay save it one more thing
as you know you need to create this same category so you need to update your web
door PHP here is the ID to display this it’s optional if you want you can change
it otherwise it will work without changing okay inside web doc PHP we were
creating out post because this time we are posting something okay
sorry this is not right here save it agree this will name of your function
inside your admin controller at the bed save sleep I am NOT copy that I am
pasting okay not only pass/fail oh this data will insert to your admin
controller go to your app and ste tepee controllers holders orphan admin control
okay as you can see you have a insert data
this type of we will add again first of all public function image here get
really same name yes we will get in we request so you
need to add this road us but here you will put cat named with request at me get ready add catch this will we be able
name is simply cats and in such with you know it is ready so we will put as add
it this this one this is a head bracket inside your area bracket okay here you
can cope with something with two lines you can copy this and paste it because
this is the same we will put and here is get me cat named will contain request
data so we’ll save it in variable that’s it if this is done then we will redirect
seem like this but you can see is done error something you can do it anything right add and we will say echo done else okay you can see inside add category
this will display category has been corrected let me test it go to your
browser reload add something okay somewhere button
category has inserted and category show Angela right so that’s it
now we will display category here why admin will insert product must
select a category okay so for that go to your products here you will create a new
: you can use CMD command also and you can do it mainly and let me create a new
anywhere this is cat ID cat ID it will be and visa so keep it like this so now
we have a only one category make it simply one one two one two you can use any number for this YK had a
more category desam save it now we need to add here drop-down for this
so user will select it it will insert here for this go to your add product
closed all apps go to your ad products blade and here here multi multiple
option to do this let me do with this categories label clothes
and here you will put select name Pet ID clothes at select inside this you will
put option first of all their newest MP say please select a pedigree
we will done it with validation so don’t worry and here you will put value that
one that ID sorry this one that one we get one so we will do it dynamically
don’t worry about that option close it save it now you will see a drop down
here is your drop down make it separate line and class it come on Troy this is
boot chef tiling okay here is your select one so if I
select it and try to add in new product we need to pass that ID so make it ID actually we need IB only not only name
you can put name also here variable get ID this will save like your variable get ID what value you need to pass this width
here and and put into and sign symbol get ID it will pass by here at idle
that’s it save it it will go to your controller so go to admin controller and
receive this type ID here request get ID that’s all now we have a column inside
of a my signal table can’t ID we will pass it hex
maybe that’s actually it is update so don’t worry you can put here okay
because we have try to insert that okay say wait reload get one is Lecter is
values one something name that name calls and price two three four summit I
think we have a error field check console is much reloaded and name at codes or go ahead play
episode that price click on submit now you have a error let me check
what is the error okay here is the L colum product info part we love okay we
have note that thing for never forgotten so wait a minute what is the pass okay token undefined at you or wait a
minute bye undefined ID we can do it with a lot like you can a lot this here it’s someone click on add product and
it’s Alex we are yet ID okay that’s click on this some data some code
surprise prickles fund a finite it’s not defining IB problem is here select ID by
newest one that we check inside inspect everything looked like a okay
select mighty passing here oh I’m sorry every time I forget to airbrush – sorry
about that let me try again
category one put that name for that code and price save it again we have now it’s
not undefined let me check here clear that and soul
select this but name through that code but price click on submit and you have a
entered here ok here is say product everything is going right response is
colum product info card we now let me check what is going into product
info productive things not personally how is possible I not remember that I
have added let me add again we have not product in soil that’s life okay put
here and sign in for two yes we nearly is pro info and here you
will say Pro info variable dollar sign hash sign throw intro dot value when we
will come from your text here is copy this okay
this clear product info make it text is one close this type text’ ID is okay close this text area in the product ID
to pro in sir save it go to your day select a category add a product name
product code and for that price and conduct in for something click on submit
button a lot time and product is at it now let me see
which category added after 26 browse now you can see is 27 with cat eye deep
one okay okay for now that’s is in this
video in that spot we will make it dynamic and inside the products blade
case we will make it surprise organized by category
that will be all dynamic so wait for the next video thank you guys

8 thoughts on “#8 LaraShop || Create Categories || E-commerce website in Laravel 5.5 tutorial

  1. static eight product in one slider working fine When I integrate
    @foreach($product as $products)
    here slider code
    @endforeach
    Please tell me how show first eight product on active slider and other remaning product to other sliders
    Just I need loop

Leave a Reply

Your email address will not be published. Required fields are marked *