April 10, 2020
#9 E-commerce Website in Laravel 5.5 | Fetch Categories dynamically | Ajax Request in Laravel 5.5

#9 E-commerce Website in Laravel 5.5 | Fetch Categories dynamically | Ajax Request in Laravel 5.5


hello friends in this video we will
complete our category section today we will display category list inside add
product form by month dynamically from my secret evil but before that I want to
show you some changes i dun’t behind the same i add a scroll view
inside div where we are displaying product data wire ajax inside edmondbina
ii when products will fetching from my second table that time we will display a
animated image for loading let me show you if i click on products and thus
starting you will see a animated gif file image for loading and second this
is this scroll view our product listing okay you can get this code from my
github I already update ok so now in the last video we added a category name and
ID which products by manually but today we will display category listing
dynamically so for that go to your favorite editor open resources view
admin and add product blade file ok we are getting ID from products form add
product form so we need only display category data from Icicle further but we
had tried to do let me show you as examples
yes your model name is cat fetch doctor all and let me reload you will see list
of array that is our category data so we need to display this over place of
optional select for that Scott health for each and app your model name you can
jewel their variable I press on this times and add a new variable see data
you can use any name for this yes and for each that’s all inside this option
you will add it your variable and column name of category name same name we have
inside of a my psychotic and value you will fit simply see data only IT save it
reload your blade you will see you have a list of categories inside your
drop-down so let me inspect to see value of your category ID now you can see we
have already this so let me try to add a new product just for testing product
code and eyes some info click on submit button product has been added now you
can see here is product if you will click on
edit you will see nothing is it means okay
now before I mean after this I need to display category name also in this table
with products for that we need a join join is combination of your two or more
tables Laura will make it very simple we need only combine inside your models
here is CAD model here is products model you need only this products model to
make a join with categories just make a function public function make its cats
you can name it anything that you will use this later return the value use this
function he longs to here you will put app and your model name is category yes
so that’s it go to your route to test this function I put here new route just
for testing a name is best and create a new function to return the value so we
done F your products model if you put here all you know it will return all
data off here products table it will be split for the
branch table data but we need get a green Emil’s so for that you will do
with yes you will use name a function from here okay
and get it now reload you will see nothing
cap is null because we have to tell system we have a kick column which is
both side here is IB and products table we have a cat ID so we will put this as
a common IB that is your phone our key okay save it now reload this now you can
see cast data is come so we need to display this in size this table for that
Clos this where we are display poor only products we will change it to width
scats and make it a get function let’s save it go to your resources admin and
add product here you have a table first of all make it one more column you
will say yeah sky will be same you can use padding is optional this that’s for
designing part here this category name the simply or you can say only category civic now go to your products blade
where we are setting this data from Ajax okay here you will add same place of
that after product code you will add here just copy this list here if you put
your cat named it will not come let me show you it will not show it’s empty you
have to put ads now reload you can see is scared
one cat two Kathy cast again is all data is according to category that’s very
nice I think okay here is simple mistake of
our designing path go to Sybil Phoebe make it cold span fight reload you can
see is now cut pain and is your let me add a new you will see in the last
category one for testing test pros just some here is ice info click on submit
and in the last you will see is your category one run latest product okay
it’s all dynamically is scroll view and here is a gift you can get all data from
my github thank you guys thank

4 thoughts on “#9 E-commerce Website in Laravel 5.5 | Fetch Categories dynamically | Ajax Request in Laravel 5.5

  1. recently i have view management demo admin page, they are using laravel framework to write ,my question is how to build bulkedit admin permission like here https://demo.snipeitapp.com/users/bulkedit .

  2. Thx for the tutoriel, but what if I have categories and sub-categories, then how do I display them in my product table according to the product ??

Leave a Reply

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