Video instructions and help with filling out and completing Who Form 8815 Dependent

Instructions and Help about Who Form 8815 Dependent

Hello friends in this video tutorial we are going to learn how to make dynamic dependent select box or drop-down box in laravel using ajax we have already make this type of video tutorial by using PHP script but we have received lots of viewer a quest to make this tutorial in laravel also so here we have used country state and city drop-down example for understands dynamic dependent select box dynamic dependent means child select box data will be depend on selection of parent select box if we have changed parent select box then child select box data will be change now let's start discussing this topic so this is our testing database and under this we have one country state and city table in this table we have already inserted different country state and city data we will fetch data from this table and make dynamic dependent drop-down by using Ajax in laravel we have already installed laravel framework so first we want to make database connection so we have opened our 10 file in this file first we have defined database credential like host name database name username and password after this we have go to config folder and open database dot PHP file and in this file also we have defined database credential you so this way we can make database connection in laravel now we want to make controller with named dynamic dependence for this we have go to command prompt and here we have already run composure command so here we have typed this command this command will make controller with named dynamic dependent which we can see here so we have open controller file under this file first we have make index method so when we have called controller then this method will called this method will load view file in which we can see three different drop-down list box for country state and city country drop down list box will be filled with country day two and state and city drop down list box will be empty state select box will fill when we have select country and city select box will fill when we have select state for fill countries select box first on header side of controller first we have right used statement with database class by using we make query and execute query now under index method we have write dollar country list variable is equal to database class with table methods and under this we have write country state city table name by this table method we'll make simple query like select staff from country state city table after this here we have right group by method and under this we have right country column name this method will add group by clause to the query lastly we have right get method this method will execute select query and return data array object which we have store under dollar country list variable now this state we want to pass to view file so here we have write returned statement with view methods and under this we have view file name dynamic dependence this method will load dynamic dependent view file and for data here we have write with method with two argument in first argument we have write country list variable and in second argument we have write dollar country list variable this with method will add a piece of data to the view file now we have go to dynamic dependent view file so this is dynamic dependent view file in which we have already included bootstrap and JavaScript library under this far we have make country select box so here we have right select tag with attribute name and it is equal to country class is equal to dynamic and data dependent attribute is equal to state here class we will be used as selector in query code Music here we have also used a to attribute which denote child select box city which is state below this we have defined state select box so here we have right select name and it is equal to state class is equal to dynamic and data dependence attributes is equal to city here also we have defined class dynamic which we have also defined in country select box also and in data dependent tag we have defined child select box city which is City for City select box we have right select tag with attribute name and it is equal to city and here we have not defined dynamic class and not defined data dependent attributes for fill countries select box so here we have right at the rate for each loop with Dollar country list variable as Dollar country here country list variable in which we have defined country list under this loop we have right option value is equal to two open and close curly bracket and between this we have right dollar country variable object country here in option value tag we have print country table column data same way for option text also we have print country table column data so this way we have filled country select box now we want to set route for this controller so we have go to web page P file here we have write route class with get method with two argument like / dynamic dependent and then second argument we have write dynamic dependent class at index method so when we have write base URL slash dynamic dependent then it will called index method now we have saved this code in check output in browser so here we have right baseurl / dynamic dependent and this URL has low dynamic dependent blade dot PHP view file and here we can see three select box here we can see country select box has been filled with day two and state and city select box has not data when we have select country select box then it