How to Create A Full Classified Website with Laravel 8 and Livewire for Beginners

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello my friends welcome again first i want to thank all you subscribers i have a 3.26 subscriber to my channel i want to thank you big thank you i have created some tutorials and i want to create a new one i'm going to start laravel classified ads something like that and i'm going to go to the level now laravel.com i have opened the terminal here i'm going to zoom it okay and i am inside the level directory and here i have all the laravel projects and here i have a employee live wire and another one called moines and this is the movie website created with laravel and vue.js and i'm not sure i'm going to create this tutorial to create something like that but maybe in the future now i'm going to create a new level project here so laravel i have created i have installed the laravel valet for all of you you don't know go to the level and search for the valet and here you have installation and install the composer globally require level valid and after that violet install and you can use values the php or the php and what version you have and after that you park the domains okay city sites and valley park and all the all the project inside the directory park has the the mine in that test okay so in my case employee livewire.test and uh marines and don't test i have installed the laravel and composer also the blue if you want go and install the homebrew i think all of if you have the mac os you have you can start the homebrew so go here and check for the homebrew and you're going to install that and you can install all the packets i'm going to create a new driver laravel new and the name i'm going to call it uh uh classified classified level or classified dots like this so okay classified ads website templates and you can search for that and in the theme forest you have something like this created with a wordpress and i'm going to create with a laravel and tywin css if you don't know go to the thailand css.com and here you have also documentation get started okay yeah now cd in the classified ads okay and i'm going to go to the github sign in okay sign in and i'm going to create a new repository for that classified ads or laravel classified dots like this create repository and add git init here uh treatment commit the first commit and git branch okay git add remote and the kit push okay everything is okay refresh and now we have only the readme because we need that git add all dot and git commit a second commit and git push yeah refresh and now we have the level all the level uh folders and on vulnerable project okay that's it for this video i hope you enjoy and subscribe to my channel if you haven't subscribed yet i'm going to create from scratch delivery classified ads with a tiling css design so see you in the next one all the best friends thank you very much hello my friends welcome again i have opened here in the browser i have opened the classify that website project and here is the project is there laravel fresh application also i have opened the terminal and i am inside the classified dots i'm going to install in this video the authentication package and if you go to the red documentation here we have a package and we have a breeze we have fortify which is for the apis we have a jet stream and passport i'm going to add the installer jet stream i think is the more compact one you can install this is uh easy to use is has everything if you want to make some uh changes is very beginners friendly this one but i think i'm going to use the jetstream because the theme is coming with a live wire or inertia and i'm going to use with live wire because i'm going to add some live wire components in this project if you want view js you comment in this video and i'm going to see what i can do maybe i can do another project with vue.js so if you would like that comment and i'm going to see so here we have go to the installation part and com copy this command go to the terminal and paste it okay i have open also table plus and i want to create uh database name classified dots okay data is not a i'm going to create new one classified ads okay so create new one classified ads okay and open that one this is because i spell incorrect the name classified this is with with two ss and now if i go here everything is okay now we need to install the jstream with the live wire so php artisan just doing install and the livewire version and after that you we need to run the npm install npm run dev and run the php artisan migrate to create the migration okay the all the tables we need here so around npm and npm run dev copy and paste that if you are using a livewire stock you should first to visit the level stack blade components okay so in our case i'm going to add some components with the live wire i'm going to run this command php artisan vendor publish and it's going to add all the components the jet stream has inside the vendor okay so around the php artisan migrate now good and you see here the css has only 43 kilobytes because we are not using oh so php artisan migrate and you you are going to see me and when i have make the analysis for the artisan command just a and migrate is the same thing as php artisan i make an alias for the for short just a and now we have created the users table password resets failed jobs personal access and session table ok after that run this command and i'm going to open this in the vs code uh okay and in the env we have the classifier dots database the same thing i have created here and the username is root and password is nothing the same thing i have in our configuration in mysql and here is the url http is coming by default when we installed the level and now we come here and refresh this one we have the registry and login routes here go to the register field take dealer here and register user and here we have the user name have a profile here is the the dashboard go to the profile and this is the jstring dashboard okay and not always taking so long maybe it's my computer profile yeah and here we can update the password you have not enabled the two-factor authentication we are logging in the this device and is using a chrome in the chrome browser so if i open this in the another browser and we are going to see it here we can delete the account and that is for this video we just installed the gesturing and then now in another video i'm going to this is using the italian css i think when you can see yeah justine is designing using italian css in other video i'm going to add the i'm going to change the dashboard we have here okay because here i want to display other things okay friends hope you are well and see you in the next one all the best hello my friends welcome again so here we are in our application and in this video i want to change the front page for that i have opened this radius theme and here we have some classified websites templates so this is uh for wordpress theme and here we have a logo we have a menu and we have a button in the right for creating a new ad here we have a form here is in her section with four search form and down we have popular categories and here we have a feature ads another one is maybe almost the same the logo menu button for to create a new ad a search form a section here and feature ads another one again the same thing the logo menu button for create new ad and search for and here the top categories and this one almost the same and i'm going to create something like this one okay for that i have open this one tile block dot cs dot cc and also i have open the our application in the vs code and here is the welcome blade i'm going to select all here and clear this one open the terminal and here i'm going to create a laravel component because if you see here we have the two components inside the app view components we have a app layout component and a quest layout thus it's coming by default when we installed the jstream authentication package and the app layout is just rendering a view which is inside the layouts.app and which is layout.app okay and the next one is westlayout the same thing rendering the layouts.quest that's it the level components i have i'm going to create new one so artisan make component and i'm going to call it mine layout component okay and now you see here inside the app use components we have this mine layout and if we see we have here in the quest layout or app layout we just render the view now in the mind by default when we create a component with a terminal is going to have the construct function method and in our case we don't need that we just need the render function or method and i'm going to change this to be inside the layouts and maybe only the this change here and save and now inside the components i'm going to remove this to the layouts just as is more uh nice if we have here okay and here we have only the div in the welcome blade i'm going to say x for the component and mine layout close this one save and go here i refresh and we don't have anything because in the mind layout we just don't have anything if i put something here h1 hello there save and refresh here and we have the hello there i'm going to copy what we have inside the app blade layout and paste it inside the main layout i'm going to remove the navigation and i'm going to leave a header and also i'm going to leave the texas jet banner okay so here we have a head ass slot name header and here we have a default slot we have the livewire script and the stack models i'm going to leave if you want you can remove no problem save that one and now if i refresh nothing happen again now i want to create one more for the navigation and in our terminal i'm going to change the artisan make a component and i'm going to call it a header mine header mine header okay open this one and here is the blade and here is the mine header class again i'm going to remove that i'm going to leave it the render method as it is it's going to render the mine header blade inside the components and that's okay close now inside the mine header blade we have that one i'm going to copy what we have here uh inside here i think we have navigation header i'm going to copy this one view code copy the clipboard and come here select all paste and save come here and tell the browser refresh nothing happened why yeah nothing happened because here we need this to say x slot with a name sorry with name header and inside this slot name we i'm going to add the component x mine header okay say we are going to work with the components here they look more nice and if i refresh now we have something like this here okay uh next thing is to have some type of form and a hero yeah here we have a hero i think maybe yeah something like this or something like this [Music] placeholder and i'm not sure what i'm going to add it here this is the same the same the same and add this one copy this copy to clipboard and come here make a component artisan may component that mine or mine hero and come here when my hero is here select all paste this one save and contour my welcome blade inside the xlot name header or not maybe after that i'm going to say x or section and here x mine hero save and come here refresh and i'm going to see that look like this i want maybe something more nice if i see here styling templates cards models no here maybe something sidebars navigation center headers yeah i'm going to add a this one and here i'm going to change with the search for okay copy this and come here to my hero select all paste this one save and we're going to go to the browser refresh and we have something like that if i run the npm around there because we are going we are using a jit and maybe we need some yeah the same thing yeah now we have something like this and it's not the same as it is this one already fresh yep code yeah okay go and find something components and heroes okay this one this one this one yeah maybe this copy and paste it here we need to add the spacing in the italian config.js inside the themes extend and add this one copy this and paste it here save those now we need to close this save here and run the npm round div again because we made some changes in battalion css config file okay from here refresh okay i'm going to remove this here because we have a okay where is enough navigation application navigation okay close the navigation save and refresh yeah now it's more nice we need to add a search button a search for and here we need top categories and if i come here i think we have something similar maybe statistics yeah iso okay or themes no no no like this uh can't ready now oh we have a footer i'm going to create one for the folder view code here copy copy the folder and come here and make component mine footer i come here and yeah here we have my footer select all paste them record we copy from there save and close this in the welcome going to add it here the x main footer here save come here and refresh and now we have a footer okay we need that now the categories and maybe this is something like that yeah yeah the categories content okay i think this is okay or if i come here and content or sections and yeah no application pricing imagination photos uh i think this is more okay view code copy clip w clipboard and come here now from here and create one more for the mine section and open that mind section here now select all then paste the code we copy save and come here we have mine hero another one section for the x mine save come here and refresh and we have something like this uh around the npm around dev okay refresh again and now he's more nice okay friends so i think we are good for this video we have a footer the mind section mine hero and uh navbar in the next video we need the add the form here change the links or links and change this to be cut categories and display the categories here but we don't have for now just i'm going to leave it what it how it is now hope you enjoy and see you in the next one all the best friends hello my friends welcome again so here we are in our application and here is the welcome blade i'm going to change the links of the names here and the title of the website here also here without the search for and i search in the internet and find this form here in the titling components.com here i'm going to add hard coded categories after that i'm going to add the feature ads and in the footer i'm going to change the color the background color so here we are in the vs code and first i'm going to start with now bar and the nav parting is inside the mine header okay so first change the name and it's going to be just classified and here we have i'm going to copy from here we have home alerts page blog and contact okay home all ads stores contact and also i'm going to say if we are glassed copy one and paste it here go and login or register and here i'm going to say if we are authentication authenticated just display the name of the user so house sorry also user name like this and save come here and refresh and yeah we have a login and register and we have a button here which is this one and we need to say post new what for post new ad here i'm going to change the bg to bbg green 500 and in the hover is going to be 200 okay and also i'm going to change the text color text to be gray 500 and maybe the font is going to be semi-bold okay save and come here to the browser and the refresh okay we have i have in the terminal i have around the mpm run watch to watch for all changes in the italian css okay now i want to add this form and we need to copy after the container so just this one and leave two divs copy this come here and inside the mine hero remove the h1 and the button and paste this code block save go to the browser and the refresh and we have something like this come here i'm going to remove this one and save refresh and now it's okay here i'm going to say popular ads so close this now inside the mind section remove the tag and here i'm going to say popular categories and maybe for here is the property property category and how many ads have that category so for example 100 ads and [Music] here i'm going to say cars and maybe some mods here and here is going to be electronics and maybe some ads here what we can say here is education health and beauty and so on education education has ads as well help and yeah and beauty also has arts and the last one is going to be others or and some mods here as well i'm going to remove the button in the hand and save this come here refresh yeah here we have popular categories and here are the category and i have at the cars here where is the yeah remove the t also i want this here we have a different background and i'm going to say here as well so when we have this one select all and add the bg gray 100 i'm going to say what if we have some changes refresh now maybe 200 save and refresh yeah now we have changes okay and now [Music] i'm going to add some premium sorry featured ads and i'm going to copy this one copy this come here and open the terminal and create make the component mine featured open the mind feature blade component and paste that code hit save and remove the bit tag and here we can see featured parts okay go out of the browser and refresh and [Music] yeah we need to go inside in the welcome blade and i'm going to add after here x mine featured okay save and refresh and yeah here we have now the featured ads and here we i'm going to we are going to add the ads but not now the last one i want to make the changes here in the footer so in the mind footer first i'm going to change the bg to be gray 700 and refresh okay and also change the text because it's not looking very well select all the text with that gray and change this to 200s and also text okay 800 this to be 300 save come here and refresh and yeah we have something and maybe a 500 say because here now we see the changes when we hover also change this categories it has text grade 900 select all them and add text gray 100 refresh okay and i think we are okay for this video now this is going to be dynamic so here is going to be all the picture popular categories and here is going to be display how much how much uh how much arts has the property category for example and so on but this in the next videos hope you are all well and see you on the next one if you like like this video and subscribe to my channel all the best friends see you again hello my friends welcome again in the previous video we designed the front page in this video i want to design the dashboard this dashboard is coming with a level jet stream when we start registering we have the dashboard like this and i have a source and i have find this in the tiling sorry in the alpine toolbox if you go to the alpinetoolbox.com and go to the nut here number from this guy and here we have the structure for the navbar or sidebar i'm going to use a sidebar and just copy this one now come here and in the up inside the layouts up i'm going to remove uh all of that and paste it here save and now if i command refresh yeah we have the sidebar here i'm going to make some changes first i'm going to add the slot here mine with a class of margin two hand padding two and here is going to be the slot the default one okay save and the refresh here yeah here now is our slot and i think it's nice if i add also the header okay and for that i'm just going to copy the header here and we can paste it above the slot save and come here and refresh yeah we don't have the what we expected so for that i'm going to add this one inside our main and save now refresh here now i think he's okay but we hadn't run the shadow yeah like this is a dashboard and here is the the uh welcome the slot default slot i want to add the username here also change the this one and come here okay or admin okay cool and here we have a drop down i'm going to add health user name save and refresh yeah here we have classified admin and now we have the username here and when we click i want to go to the logout so when we have a drop down and if i open the navigation menu here we have as username profile show if you want to go to the profile so i'm going to copy this one and come here and say profile and it's going to go to the profile okay and the next one is the logout and this is going to be a four so i'm going to copy this one sorry and come and paste this one here log out this is going to be anchor tag for logout and just log out we need to add this styles to this anchor tag okay class and if i save come here and refresh okay we have profile and it's going to go to the profile yeah and also we have the logout and it's going to log out this is the okay so this if i got now again the register page and register with a fake filler it is a new user and here is our dashboard the username profile logout and we have two more links here removed them okay refresh yeah and it's responsive sorry is responsive safe okay friends uh this was for this video hope you enjoy if you change the you see here we have a bt white and if we have a dark mode we have a different color of text and so on this we are going to change in the next video for this video we are done hope you enjoy and all the best thank you very much hello my friends welcome again so here we are in our application and in this video i'm going to create the categories so if i go and register okay i'm going to register us with a fake filler and here is our dashboard profile and we can log out okay i'm going to open the vs code and also i'm going to create the category model and migration so in our terminal uh our terminal we need to do is run the artisan make model and it's going to create a model for the category and dash m for migration and model created successfully and also created the migration with this name okay open the vs code and now search for categories and here is our category migration we have the id and timestamps by default it's coming with that command we created and i'm going to add the string for the name also the string for the slack and the same thing for for the image okay save this one i don't need to run now the php if i open now the sorry the table plus okay and here we have the classified ads open we have the pilot jobs migration password resets personal access token session and users tables if i run now the php artisan my grade yeah it's going to create the categories table and here it is name slug image created out and updated out okay i'm going to create another one for the subcategory subcategory and here i'm going to work with the face voice in case and if you go to the level dot com and search for the or in case this is how you can use it if you can use this one or this one and now i'm going to open that so sub categories and i'm going to add something like this just to copy that one and paste it we need to change the the id not user id but category id because this is going to a sub category of the category which is the apparent okay so in the models we have category and this is subcategory we are here we add in the category id and the subcategory is of that id we have in this category so if i have we have uh electronics here with id1 we created sub-categories for that electronics for example the pc laptops and so on so we add that and we need to add the name as well table string or the name and for the slug also i'm going to add for the image and the image is going to be nullable okay save close and migrate artisan migrate and it's going to migrate the field so now if i refresh we have subcategories here and we have category id and all of that and i'm going to create one more so artisan make model and not sub sub category but i'm going to say uh cheat category category and now open that chat category and we are going to do the same thing just change the id here to b now this is the child category of the sub category okay and we need to add the sub category id here and also we need the name and and the slug also i'm going to add the image because it's going to be sorry it's going to be uh okay save and first we need to run the artisan command migrate and we have an error because here we need to say maybe some category id like this save and already exist migrate fresh and yeah now we have everything okay but i want to say do one more thing and i'm going to add the on delete cascade in our sub category in the child category so here i'm going to say on delete cascade and it's going to delete when we delete the subcategory we are going to delete the category of uh the subcategory okay so how i explain well so if we have a subcategory for laptops and here for example we have a child category for april and surface and dell or lenovo okay if we delete the subcategory of laptop we can delete also we immediately delete the dell for laptops and apple and lenovo and so on the charts of categories and the same thing i'm going to do in the subcategory so if we have a category electronics and we have a subcategory for that electronic for example we have a pc laptop and so on if we delete the electronic category we also delete the all the electronic circuit device hope you understand and now i'm going to make artisan migrate flash again and open this one refresh we have a categories it's extracted like this and sub categories category id name slug image and also the images okay is no level and child categories also the image is no lab okay in the next video we i'm going to create a category and i'm going to copy the this form so if i come here and open the web php in the in our roads and here i say road get or resource and for example we need a user controller for that first so open the terminal and artisan make controller and i'm going to create this inside the admin folder and say admin a category controller okay now here we have a inside the http controllers we have admin and here we have a category controller and now here we can say road resource for the categories and use the category and import that category controller up here save and now in the category controller i'm going to say to give the method for index and just return hello for now and just a test save and when we have a main layout okay to alright uh up layout yeah the app layout we have so if we go here and we have a blog and i'm going to change that to be a dashboard first okay so here we have a block i'm going to say dash board and dashboard is named dashboard so the strap is going to be wrote that board okay after that we have i'm going to say category and all for that we have a road index and maybe categories like this save come here refresh we are not log hit the register because we make a artisan [Music] migrator fresh so we need to register a new user fake filler here go and register and now we here we have a dashboard if i click we go to the dashboard and here we go to the category index and we return the hello from the category controller index method okay and so in the next video we are going to make a crowd for the category and see you in that video hope you enjoyed this one all the best friends are the best hello my friends welcome again here we are in the dashboard of our application and if we go to the categories we just return a string hello for now and if i go to the ps code we have registered the road resources cat catwalk categories and we can we add a category controller and if i open the category controller i have the category controller resource created so we have five methods five actions index create store show edit update and destroy you can create that by by running the artisan make controller and our dash resource in the end okay and here in the index the index method is under uh slash categories and we return the hello i'm going to change this and we're going to return the view admin is not yet created but admin uh categories categories dot index save and go to the views okay here we can create now new folder for the admin and here again new folder for the categories categories and here a new file index blade index dot blade dot php and here i'm going to add x app layout and if i save now come here and refresh yeah now we have the layout but you see here we are inside the categories and the dashboard is highlighted and this is because if we go to the up blade inside the layouts here we have a dashboard and the dashboard has bg gray 200 and the other says transparent for that i'm going to create a new component so inside the component here now here is here i'm going to create a new file call it a app link dot blade dot php okay and here i'm going to copy what we have in the nav link here in the vendor jet stream components copy all from that and paste it here and one more thing if you go to the app layout i'm going to copy the the style here and go and this is going to be up here and the other is going to be here paste save this and now if you go to the index now app layout here we have a navigation and we can add x up layout and sorry x up link and add the shaft for that link in for this is going to be a dashboard okay so road dashboard and active because if you go to uplink sorry here we have the props active and if this active is active we add this style otherwise we change the style okay for that i'm going to say active if we're going to do the same thing as the jet stream has done with the links okay so we have the link here and the active is if the request wrote is for example in this case is teams dot create or teams show okay we are going to do the same thing so active if the in our case if the road if the request road is and the road is dashboard okay close and just say dashboard here okay close that uplink and save and refresh to see what we have we have an error if the request wrote this and why if the request is a method save refresh and yeah so if we go to the dashboard now we have this one okay that's cool so come here and remove now the other links and copy this and paste it here now change this to be categories index that index and if the road is at the core is that index we add categories and save come here refresh yeah and now we are in the dashboard if you go to the categories yeah the categories is highlighted okay and here i'm going to add [Music] where we have a dashboard so i'm going to copy what we have here and add it here james is not dark board but say cutter go release and also want to leave for now but just to see here we have a categories and here i want to display uh a table okay and if we go to the not talon here we have tile blocks and i think we can see some examples table table tables table team now where is table yeah here is a table or you can go to the italian dui thailand css and documentation components and try out and here we have some examples here this is the pagination okay okay okay yeah here we are the table and i'm going to copy this one and paste it here now save come here and refresh and here it is the problem is because we need to remove this kind of thing okay save and refresh yeah let's move that now and uh here we can do if we go to the controller i want to say categories it's going to be category not a whole but make paginate by 12 and here we can add compact categories and hit save and now in the index blade we can say for example the name yeah and the category has slack and the image okay i'll remove that and here we can say name slug and image names like an image remove that and i'm going to remove all and this one and here we can do is for it sorry for it another sign categories as a category and paste this one here okay for his categories category here we can display the category name category name here and save from here refresh and for now we don't have any category i'm going to say here container and my x auto save come here refresh and why it's not in the center this one flex and if we add in the up plate here we have flex so window with full refresh and yeah now we have with fold here and this is in the center okay looks good with full we had the header and in the index we had the container makes auto refresh and here you have a table then with pull and i'm going to say width full by default okay okay save come here and refresh and yeah now it's look more nice and here we can if we have a categories we display here that's it for this video friends hope you enjoy and see you in the next one all the best hello my friends welcome again so first in this video i want to change to make a work this login and register link because if i click now we need with nothing happen so we need to go and type the link manually here but i'm going to fix this now if i go now to the vs code and open the header or mine header yeah and here we have the login and register links and we need to add them so chef and it's going to be the road for the login road login and the next one is for the register road register save uh come here and refresh now if i click register we are here fake builder a registered user and we are in dashboard we have a categories here and for now we have only the empty table i want to add the button here to when we click we go and create a new category so for that i'm going to open the index in the admin categories folder and here we have the table i'm going to add it here div with a class of margin two and padding two flex or with full full and i'm going to say bg gray 100 if i save and come here refresh and yeah now we have this one but if we see this he has uh if we are in large we have negative mx 8 i'm going to remove this and also remove this one and save from here refresh and now we are in the center here yeah well but because we have now the ft the x here i'm going to say the same thing here so negative margin two and copy and paste it here okay another one now large is this one okay and another one is going to be the same thing as this one so copy and paste and closed save this and come here refresh and why is that because here we have we don't have the picture okay i have a refresh why not copy this how it is and paste it here just to remove the table and see what happen yeah we have the same thing but now here i want to say a shadow and i don't want a butter a border and not a shadow here i'm going to say flex and justify and and here i'm going to add the div or link sorry a link with a class py2 and px 4 and margin 2 bg green 300 and over bg green 500 text is going to be okay and say new category okay save come here refresh and yeah here we have but i'm going to change this to be 500 and another 300 and also it's going to be around that md save we need to run the npm run dev and run watch to watch for the changes we made here because we have the mod is jit okay i refresh again and now yeah okay cool so now when we click here i want to go to the categories index create come here and say at the road so road categories create and save refresh here click and now we are in the categories create and if i open the category controller here you have the create method i'm going to return a view admin categories create that view is not yet in our folder so we need to create that in the admin categories create that create blade.php and in the index i'm going to copy hold and paste it here you need to change something a new category here and here i'm going to say justify start and change this to be to go back so just back and categories index okay if i save we need to remove the table because we don't need a table we need the form here save and refresh yeah so now we have this back button if i click we go back to categories new category and back and forth okay uh i have in the tiling play so play italiancss.com inside this link you can go and find this if you want this form i'm going to copy the form here and come here and paste save that form and the refresh and yeah here is our four we need a button i'm going to remove the shadow here and add it here [Music] shadow we don't need a body only a div form now you can find also in the thailand ui okay talent ui you can find some form like this this is the free one and you have the payo version here you can find anything in this thailand ui.com about italian css components if you want okay so i'm going to copy this one and make look nice yeah copy and come here and inside of instead of what i had i'm going to remove and paste that and i'm going to make some changes so first remove the p tag here and also change the profile to be create category and method action is going to be road categories store we need that the csrf token okay change this to be uh name because we need the name in the further categories we don't need this input type text and name change this to be name type text and the placeholder also name we don't need the about we need the image and we don't need that none of them just add the other pieces and paste it here okay cover photo so save this and if i refresh here is the form and need this is because we have a border for the gray here we need to remove that and refresh now okay preview the preview has a different color here and very white here but why in our case i'm going to remove why is that so deep and great i'm going to remove that two this here and just leave that one to see yeah the same thing nothing happened okay we have a name and a file and i'm going to copy what the class is here and paste it here refresh yeah now we need to choose a file we have a i'm going to change this look here greet this div okay at a class with bg gray 200 save and refresh not this one but here bg create 200 and refresh the same thing here okay uh again one more time sorry friends so here i want to say bg k200 and margin to refresh also padding 2 refresh and yeah now it's login more nice for me we have a name choose a file and the button here the button is in the right text right no save and i want this button to be here yeah now it's okay all right cool now if we go if we go to the category controller in the store request because we made uh we add the action to the road categories store and the store method action is handling that so first i'm going to open the terminal and create a request so artisan make request store category request i'm going to name it and open that store category request make some changes change the authorized to true okay and here we need to add the fields but before the fields is the name which is going to be required and minimum of the characters is going to be 3 and also we have a name sorry image this is going to be just required for now and save close this one also we need to add the product that fillable in the model so open the category model and here we need that protected feed label another array of our fields which is named a slug and image save clause in the store now i'm going to in the request i'm going to change with the store category request and here i'm going to check if the request has file and the file this name image okay so where is the file input type file id image and name image here anyway why we have a div here input something has been around here yeah okay if we have if the request has file image i'm going to say sorry first the path is going to be you need to go to the laravel documentation and in the file system search for the file uploads and you can see how we can store the image or files in the level it's just easy add the request file and the name of what we give it here so in my case his name is image and that name added here and store to the this is for the folder inside the storage we have up public for now we don't have any but if you add if we add here so the request file in my case is image and i say store and then i'm going to say categories okay here you say avatars in my case is i'm going to say categories and it's going to create that folder here and store the images okay now i'm going to say category create and it's going to create first the name is going to be the request name and the slack is going to be sorry str slug make sure you import that the request name and the image is going to be the path we added there import the str okay and i'm going to return redirect to the route categories index so if we have a request we say that otherwise i'm just returning back again or just return yeah i'm going to copy and direct the user okay save come here and try refresh so we validated the fields we had the fields in the model and if we have an image we create that because if we don't have an image we don't have we don't leave the image blank if i refresh now and we have a class yeah i need to add a div save refresh and now i'm going to say php choose a file open that file and hit save and we're directing back so something is wrong because we don't display that we just redirect back i'm going to say here if the request has file image i'm going to say dye and dump now image okay go to the new category php choose a file open and save and yeah we have no image wise if the request has filed image is not working this one we have a file form oh yeah the we need to add the multi-part form data to work with files okay so come here and paste that save and now go to the categories again new category and choose php a file hit save and now we are back and we have the name php slug and why we don't have a slug refresh here yes luck is php and the image you see is inside the categories and the random name if you go here inside the public refresh inside the public set the app we have categories and the file what we need inside the categories so inside the public not inside the categories set up anyway so we have the file here and why we don't display the in the index i have a table and don't display the yeah copy this and paste and we need to display the slack because here we say name slug in the image okay and also here i need to display the image save and refresh here and here is the name the slack the image is the link of the image the url or the path we can say and that's it for this video because it's going to be long if we made some if we make some other changes hope you enjoy and see you in the next one all the best friend hello my friends welcome again we are in the categories and here we display all the categories here we have the path of the image the slack and the name and here we have a path i want to display the the image and if i open now here one more thing i want to say is we save inside the app categories and we i want to change that so in the category store here we have the categories change this to be public slash categories and save and now come here create new category for example and choose a file open that file and save now the slack the path is inside the public slash and categories okay uh yeah i want to display that so if i open the resources index and here we have a cut taker image and i'm going to say cut this image and then class it's 12th and with 12 and maybe around it ok and source is going to be storage url and pass the category image there category image and close that image save and refresh and yeah now we have the image here if you don't see that you need to run the storage link php artisan and storage column link okay and now we have the image okay now in this video i want to make this edit button to work so if i click here we just add the hash but i want to edit and so here we have the edit button so edit and with that i'm going to say uh the road is going to be categories edit and we need to add the category id here okay save and now come here and we have i'm going to remove this we don't need that we have the edit method and here i'm going to use road model binding so add here the category model and dollar sign category and here we're going to return review admin category edit and add the category here okay so we have a category we don't need to make a category find the id but we add the road model binding here and we passed the category to this view we don't have this file yet i'm going to create now so here we have admin categories new file and edit dot blade dot php go to the create and select all here copy and paste it here save for now also save on the controller and come here and refresh and if i click here now we are in the edit and say the same thing as new categories has here okay now we need to make some changes in the edit blade first here we need to change the this to be the category name here take our name and here we say edit category here we have a name remove the placeholder and add the value here a value is going to be the category name and image i'm going to display here the image div with class with full margin to padding 2. and here image with class age 32 and with 32 sorry image not i am img like this we need that source with a storage url which is a category image and save come here and refresh create but in the edit here we didn't have the file but if we click here yeah now we have the image here and i want to update this one so we need to change also the action to be categories update and here we need that id category id method post we add the csrf token and also we need that the method here is going to be put and i think we are okay here we need a good controller and we have the update method also here i'm going to say category and run sign category so i'm going to use the road model binding and here i'm going to check if we have a file as file image i'm going to say the category but first we need another path so i'm just going to up here and paste for quick okay we are going to store the image if we have an image we are going to start like in the store method and after that we are going to update and the name is going to be the request name also the first lock is going to be updated str slug and request name and the image is going to be the path okay but if we don't have an image we are going to update the category just the name like this and after that i'm going to for now return redirect to this road in both okay come here refresh and laravel developer i want to say here save and we are back we updated the name and the slack also and the image we don't update so i'm going to say to see if we update in the image choose a file here so in this case we don't have the category with id1 choose file and see what happened save and now we updated the image okay uh one more thing i'm going to do is to and here again i'm going to use road model binding category and category delete and return redirect there or in the index i'm going to say here we have edit and i'm going to add one more for the delete so copy this one paste it here and change this to be destroy this to be deleted this will be red also red here save come here and refresh and now we have a delete button a link and if i click here one sorry uh come here and categories destroy and we put the category there but i think we need we need that the maker if we go to the app and see for the logout sorry mine header when we have login username not mine header where is the app layout and here we have form yeah i'm going to use like this copy this one and here i'm going to say the same thing csrf road is going to be at it gouris dot destroy and we need to add the method it's going to be delete and here so the method is going to be destroy and delete here class class is going to be text red 500 on our text red 900 save and refresh oh yeah we need that parameters here we need that okay and also here save refresh and click delete and we delete it and redirect it back okay friends hope you enjoy uh one more thing i'm going to say here with message uh category deleted and the same thing here update it and also here and here updated with image for now [Music] and here created okay save from here refresh create new category laravel choose file open and now i forget to display that message so in the index here we can say if session message here we can say div with a class bg indigo 400 text gray 200 or maybe indigo 600 here 92 and padding 2 rounded and here we display the message so session message and save this one refresh go again another one laravel developer here choose a file open save and now we have a category created okay edit that category edit that save and now category updated without image okay so here we have a category updated with image and without just updated so if i update with image now we change that uh choose file and say this one save and now category updated with image okay now delete and category deleted okay friends hope you enjoy and see you in the next one all the best friends hello my friends welcome again in this video i'm going to work with the sub categories here we have a category we can create new new one for example with file with images save and now we have here we display the name the slack the image we have the edit and delete button okay we show the message up here now if you come and open the web php in our routes we have this route for the categories i'm going to copy and paste and say sub categories and also make make a controller for that so artisan make controller and say subcategory controller resource and come here and also change this to be sub category controller okay save now this and in our in our mind now in our update we have the categories here copy and paste this one and say subcategories and the road is sub categories dot index save come here and refresh this one and now we have subcategories here and we don't display anything because we need to go to the subcategory controller here we have the index and we do sub categories is going to be or we can do like this and sub category model and say for example paginate by 12 and return the view which is not yet created subcategories index and we need to paste the subcutaways here stop categories and save this now we need to go to the view admin and create new folder for sub categories and here new file index.blade.php index blade.php and come here and copy select all copy and paste in the sub category index now we need to change some thing here we can say sub categories also here sub categories new sub and we have name slug so if i open the database for the classified dots open and sub categories we have the names like an image yeah the same thing slug image and here we can say sub categories as a category and for each and one more thing so if i save and come here refresh yeah we have some algorithms here in your subcategory and if we want so we don't display anything here because we don't have any subcategory yet but we can do for for else or else and if we don't have if is empty we can say now sub categories save refresh reach no end for each and for else and now we have this now now sub categories maybe we need to make some changes so contents say div with class of margin 2 and button 2 and paste it here and now maybe it's looking more better okay now when we go and create we don't have anything so we are going to do the same thing go to the categories in the create file select all and copy and now go to the subcreate every new file and create dot blade dot php paste it here new sub category and also here subcategory index uh create subcategory and we have the action it's going to be in the road for subcategory store method post the same thing name image and one more thing we need i'm going to copy this and paste it here and now change this to be category and here we need to add the select select and option yeah here we can see for each for each app models category all as a dollar sign category and cut this base it here and here we can say the value is going to be category id id and here we can display the category name dot assign category name and hit save come here refresh yeah because in the subcategory controller we need to go to the create method and return the view uh admin sub categories create okay save refresh and now we have a category for laravel and diabetic developer because we have only two yeah new subcategory we add name and we have a chosen file okay so the same thing as we did in with a category just come here and check if we have an image copy this come here and paste but instead of the category change this to be sub category and str we need to import str okay public subcategory name slug and here we need the category id so category id is going to be the request category id and the cloth of the create blade here select we have the value for category id and again add the name category id okay save and also save here and everything is okay come here and refresh now to the name sub one for example level choose a file open hit save and that name property so we need that to the model open the sub category model and also i'm going to copy from the category model so copy from here the same thing paste it here and we need to add the category id save come here refresh again test laravel choose a file open hit save and now you read the exact categories but if i go here we have the test okay this is how we can create a sub category next video we edit and delete so see you there all the best friends hello my friends welcome again so here we are in the sub categories and we can create you know sub category here give it a name uh choose a category here choose a file and open it save and yeah we create a sub category but we redirect back in the category because we store here and redirect categories change this to be subcategories.index with message subcategories say created okay save this and try again another one a file open save and yeah we have a cut subcategory created but i don't like this message so in the index we have the session if the session cut from there and we dial it here margin two padding two remove the row that md text large and 100 maybe and also text center hit save i refresh refresh again new one some random open save and now it's okay subwater will create it and we have there now i want to edit and delete and for that i'm going to open the category controller because i want to copy what we have here and paste it to the sub category so from here paste it here we have a store and change this to be subcategory and this to be sub category like this also this one and change this to be sub category here edit uh also the same here sub category and subcategory here also here when i store sub category update a name slack and the path but we need one more field because we are in the subcategory here we need the category id and it's going to be the request category id and the same thing here and we redirect the subcategory index with message subcategory updated okay also here sub category and subcut every delete and go to the subcategories index with message subcategory deleted and i think we are okay yeah hit save and open the uh add me subcategories and create new file here for the edit lay.php and go and copy what we have in the edit of categories no sorry what we have in the create of subcategories select all copy and paste it here change this will be edit sub category and not create changes to be update okay method post and we need to change this to other method again to be put placeholder and i don't say you but i add the error in the create of the categories okay so here we add error for every field we have so go and create one hit when we are here when we create so we can add the request i'm going to create request sorry open the terminal and artisan make request store subcategory request close this and open the sub category request change the authorized to true and add the name to be required [Music] category id also required and the image also to be required hit save and close this and open sub category sorry open the sub category controller and now add the sub category request here and save also save the edit for now and in the create refresh hit save now and we have error for the this field is required but for the category we have the category so we don't have and also the the name field is required and we have this class error so select this and change the b class bg not bg but text red five hundred and also i'm going to cut and paste after okay and here and here so you call me refresh save again and why we don't have a text red 500 and also we have in the right maybe we need to run the npm run tab okay run to create new file for the css refresh nothing happen again i don't know why don't have this i say text rate 500 that's okay okay change this to be div maybe and here and also in the name yeah in the name image hit save and comment refresh yeah again okay uh i'm going to leave this for now i don't know why it's not updating the npm around watch okay so i'm going to leave it and i'm going to see in the background so here we are in the create go path and i want to update now go to the edit not found i subcategory return the admin and we don't have success not found administrator is edit and we have here the edit blade and not found iris categories so in the index of the subcategories and we have we need to make changes here so here sub and there is again here and also here go back refresh and now go to edit yeah we are in the subcategories when i did but we don't display the name because we need to say where we are in the name what is the form here and the name is here change the placeholder name to be the value which is going to be the sub category name and here we we have all categories here we're going to say if the category id is the same as the sub category category id says selected otherwise nothing and the image i'm going to display the image so if we go to the edit in the categories here here we have our image just copy from here and paste it here and change to this to be sub category image save come here and refresh open image new tab storage we don't have a name nothing why why is up on that so if i open the id here and it's not working the road multibanding because we don't have we change the name here okay friends so if i add sub category like this and say sub category find like this refresh and define variable subcategory yeah i make a mistake here sub category and copy refresh here now we have the titan here the image and all of that okay so if i want to update copy this and first we need to say some quality refined by the id now because the road model binding is not working because we change this name here if we say sub category like this is going to work but i'm going to leave like like this and i think we are good to go again here the same thing i'll try d hit save come here go back refresh and i'm going to delete this asap we deleted again again and again the deleted method is working so in the edit i'm going to update test updated save and put method because in the edit okay my friends need to change this to be update okay go back refresh and why is missing the road supporters update yeah i know what's up there is update need the sub category id and now we are okay so if i change to update it hit save and we have the updated okay edit we have learned if i change the developer save and now add it again we have another developer hope you enjoy friends all the best and see you in the next one hello my friends welcome again in this video i'm going to work with a child categories so if i have i open the table plus and classify that web database we have categories sub-categories and child categories this video i'm going to work with that is going to be the same as with sub-categories so if you have understand what we do skip this video and watch the next one if you want to watch okay so i'm going to open the vs code and open the terminal here artisan make controller and then let's say child category controller resource okay close this one and now open the web php inside the roads and copy this one paste change the sub category child categories and also here child category controller import that up here hit save and here we have categories subcategories i'm going to create new one new folder for the doris okay and here new file index dot blade dot php and i'm going to copy what we have in the index of subcategories select all copy and paste this one and paste it here just change these to be child categories uh session message okay also we need to change the route to be chat categories create new child category we have a name for that so if you come here uh structure we have name subcategory id is like an image the same thing select image just change this to be child categories category and that's okay also here change the child categories okay and now child categories here i think we are okay save and now one more for the create create.blade.php and also copy from here and paste it here new child category road change again the big child category index categories index and create child category also here we wrote change the chat categories dot store method post and we have a name letter for the name category and here we need that sub category and also here sub category as the category and that's okay here sub category id sub category like this and we have the image and that's it hit save one more for the edit dot blade dot php and copy what we have here and paste it here and also the same thing we need to change all the sub categories to be child categories and we have a name okay here we have subcategory again and here sub category and also here sub category id and option value category id category if that category id is the same as as the child category sub category id so in this case we have the chart we're going to return the child category in the controller admin chat category when we edit we are going to add the child category here and we are if the category id is the same as the or we can do to be more understand understandable so select this and change to be sub category like this so if the subcategory id is the same as the child category subcategory id so this one is going to be selected and here start started url and child category okay and i think we are good to go error for the subcategory yeah save and we need to close now open only the child category and this one open on the side okay so here in the sub the way i want i'm going to copy something from there and add it here first thing in the index method we are going to say dollar sign child categories is going to be child category and paginate 12 and here return the view sorry admin child categories index and add the child categories here okay next one is the create and here i want to return the view admin child categories create okay and the store i'm going to do the same thing so you are here copy this one and paste it here if we have an image the path is going to be inside the child categories and the name here child category create we need to import that and here sub category id is going to be the request sub category id and here redirect the child categories index with message okay actual method we remove that in the edit i'm going to return i'll view admin dot child that we go is edit and add here we need to say child category is going to be with child category find the id and here we need to add that child category okay and now we are in the update method and i'm going to do the same thing as we did here paste and change this one to be child category find id and also select all the change that to be child category if request has image change this will be child also here type categories index and i see we have here redirect to other categories instead of subcategories okay so copy and make changes in this one as well and copy here and paste it here and now in the destroy we are going to say the child category is going to be child category find or fail in this case just to demonstrate to you and child category delete okay and return redirect to the road child categories index with message deleted just that okay save and i think we are good to go and one more thing if i open the up blade layouts and when we have the road for the subcategory copy and paste it and change the child category and here as well to be child categories and save from here refresh okay we have the child categories here select that and we are there go and create new one name is child and we have these sub categories here choose a test choose an image okay i think i don't have any image for now i delete it all so just uh laravel and the image go and download this one okay save come here and choose a file now the downloads we have that one open hit save we are back i we need to add the properties to the child category model so here we need to say protect that the feedback is going to be an array of name slack and sub category id hit save come here refresh continue and we are back but i think the image by laravel view js choose an image open save and again the image is not there or maybe if i open the index in the child categories and when we display the image okay started url the category image and if i go inside the public we have the child capital is here and also we have the image here but why we don't display there so in the index we say storage url also here refresh this and go to the data and type we have two chart categories and the image is not why is that child category controller update create store if the request has file the path is going to be the request file image store in the child categories and image is going to be that path i sorry fans in the model child category we need to say the image here image hit save come here and refresh new again php test updated choose file now open hit save and yeah now we have the this one go and edit the first one the child and possible typo here subcategory i think the message is very well possible possible typo here did you mean child category okay in the edit subcategory not here chart that we edit and here we have to say child category here and update child category and save come here and refresh again and where is this one now in the value okay so provide your child so select all and not select all because we are going to change chart category okay and here we have sakadora sub category what is a category and here it's okay image yeah hit save from here in the refresh and now we are okay i want to choose a image open and say here updated hit save and now updated slack updated we have an image and and we have a message here now i'm going to test the delete see if it's going to work so delete this one and we have the argument string given category controller okay we have a delete finder fail id and delete with message yeah sorry friends got this one and say like this save refresh continue [Music] and now go back here we have two because it's going to delete method is work so if i delete again and delete it okay friends that's it the uh child category crap see you in the next one hope you enjoy and all the best hello my friends welcome again so here i am in the dashboard and for now we have fix the categories grad subcategories and child categories and we need to add country state and city as well and for that i have opened this github repository laraveler this is the level employee management repository okay and here if you go to the database and we have the countries table also the states and see this and i'm going to copy from here and paste for more quick and this is the extension i installed in the chrome so opto-3 if you want you it is very easy to navigate in the github repositories so you don't need to wait and reload just look for what you want and click there anyway so i have opened the vs code here and i'm going to close all that and open the terminal and artisan make model and we need the country and m for migration okay and i'm going to create the state model and dash m for migration as well and the city okay close this one and now open the countries table i'll go come here and navigate to the countries table here and i'm going to copy this one copy and paste it here okay save close this one now i need to copy the states table and here we have copy this one come here and open the states table and paste it here so we have the id and we have the point origin id for the country id and the name save and for the city come here see the city copy this and open the cities table and paste it here hit save close open the terminal and click the artisan migrate and we created the countries states and see this table okay now if we come here and go to the app models and country we have this product that fillable or the country called the name and we have the states relationship so come and copy that and go to the country model paste this one [Music] hit save we can create a manual if we want but i think he's more uh quick to show so we added the fillable which is in the so if i open the database here classify dots and now we have countries structure we have country code and the name and we added here a sprocketed fillable we have done this with a category as well name slug and image and we create the state's relationship i think you know that now come here and copy the state we have for a country relationship and for city copy that come here and open the state model and paste that in save close this now the city model the same thing copy and paste in the city model okay hit save for what i do yeah hit save and [Music] now we are okay we need to create the controller for the country state in city so country controller another one for the state another one for the city okay and that's it for this video in the next video we are going to create a craft for the country and so on hope you enjoy friends all the best and see you in the next one bye hello my friends welcome again in this video i'm going to work with countries here i am in the terminal i'm going to open this code here here we are in the browser we have work with category subcategories and chat categories now i want to add it here the country and open the vs code i'm going to open the web php roads we here we have the category subcategory and child categories i'm going to add one more route resource and here i'm going to say countries and country controller import that country controller hit save and open the up blade in the layouts here we have a child category above or after that i'm going to add the countries and here with index hit save come here and refresh and now we have countries here click for now we don't have anything because if i open the country controller we have the index method and he's not returning anything so first i'm going to create the views so inside the admin we have category style categories and subcategories create new folder for the countries and here new file index dot blade dot php the same thing sorry new file for the edit dot blade dot php the same thing we have here and one more for the create create.blade.php okay i'm going to copy what we have in the categories index select alt copy and paste in the index of the countries and change this to b countries here also the route countries index click on this create create new country and here we have a table for the and if i open the table plus okay open to classified dots countries structure and we have a country called in the name so the name slack and change this to be country code and here change this to be countries and also here to be country yes we don't have the image so here we just need to display the country code country code name sorry country and country code like this uh change the roads to the countries and i think we are good save this one and come to the country controller and say dollar sign countries it's going to be country paginate and by 12 return the view admin countries index other compact countries and i see i have made a mistake in the other for example in the categories and so on so after the table or any where you want you can add the links so here i'm going to say countries links like this come here refresh and now we don't have any but in the categories we have three and if i go to the categories index here i say the countries sorry they go categories links and hit save now go to the categories refresh and also i need to open the category controller and change this to b2 for now just to demonstrate to you refresh and a category controller category but in 8 by 2 and the y is yeah now we have the paginate okay and maybe we need to add some controllers some classes here so cut this and not in the deal with the class of parting 2 and mod margin 2 and paste this on save refresh and now yeah we are more good to go the same thing for the index here add a div with the class padding 2 and margin 2 and paste that in okay now we don't have any countries yet won't yet if i go to the new country we navigate the countries slash create and here we don't return anything so i'm going to return the view countries create hit save and [Music] i need to open that create and also the categories create select all copy and paste it in the countries create new country changes all the road countries index create country like this and countries store method post we don't need the only part form data because we don't work with a files here we have the name and the input type text id is for the country code country code name also country code and the save button save this one refresh and now we have the create country and name and we need to change this also country code save refresh and now we have country code here and we can add the placeholder as well in the input of country code okay so here we can say placeholder country code save refresh and now we have a country code okay now it's time to open the controller close this one and open the country controller and we have the store method i'm going to create the request for the countries so artisan make a request and change this to the store country request okay close this one and here now we import that we have that so country store country request and i'm going to open that store country request change the authorizer true add the rules and we have the name it's going to be required and also we have the country code it's going to be required hit save close this one and now we can say a country create and validated and returned redirect to the road countries index with a message country created and hit save sorry the request request validated save this one and refresh choose a name for example united states of america and usa save button where direct back and country created okay yes but this is not the same as i want so in the country index why is this message i need to remove from here and also in the categories here because in the others i think i added yeah so come here and close this one and paste it here save and also the same thing save close this one open again refresh no refresh new country and for example united kingdom and uk hit save and now yeah here we have in the center and the full width of the message okay friends that's it for this video hope you enjoy and see you in the next one all the best hello my friends welcome again we are in the countries now here we display all the countries we have we can create new country now in this video i want to edit and delete the country so if i click edit we go to we navigate to the countries the id of the country and edit if i open the vs code and here in the country controller we have the i need to remove this one we have the edit and here we have we expect the id here which we have here one so now i want to do is use road model binding with laravel 8 we can say country dollar sign country and here just return the view countries at it and we pass the compact country okay like this hit save and refresh so if i go now where we have the countries edit blade we don't have anything here go to the categories edit late select all copy or not sorry [Music] the countries create select all copy and paste in the edit paste it here just we need to change something so here edit country update update country here and go back yeah countries index that's okay remove the placeholder and add the value value is going to be the country name and we have the country here because we passed it here okay we expect id and we use road model binding behind the scenes is going to say country find and id but it is very useful if we use like this okay so we added the country name and here add the country code so value country and country code and change this to be update and also we need to add the update method here update method post and also override the method to be put hit save and come here where we have the update and here so i'm going to use road model binding so country dollar sign country and i'm going to use the same thing we use in the store so store country request store country request and here the country update and the request validated okay and copy this one and paste it here message country updated okay hit save come here and refresh and missing yeah sorry friends in the edit blade in the action we add the update route and we need to add the country id it's even if the error uh is very useful here so it's a missing required parameter for road countries update okay now we have the country name and country code here so if i remove the let's just leave the united states and hit the update go back we have only the united states change again to be united states of america update and yeah we have again and we have the country updated message here now the next thing is to delete and if i come here also the same thing i'm going to use the road model binding country dollar sign country and here the country delete and country deleted we return redirect to the road country index refresh delete this one and country deleted you see here delete the next one and now we don't have anyone hope you enjoy friends and see with the next one all the best hello my friends welcome again so here we have the countries we can create edit and delete countries in this video i'm going to work with a state and if i open the table plus classify that here we have a states and we need the country id and the name okay i'm going to open the application with vs code okay now here we are with [Music] states web php copy this and paste okay change this to be states and also the state controller import that and hit save and close this one now in the here we have a countries i'm going to create new one for the states new sorry new folder for the states and here new file index dot blade dot php another one for the create dot blade dot php and another one edit edit dot blade dot php okay now open also the state controller here we have the index method and the states is going to be state model paginate by 12 and we are going to return the view states index and other states here hit save and now i'm going to what we have with the [Music] subcategories yeah so we have sub categories here but first when countries country's index select all copy and go to the index of the states paste it here we have the message okay change this to be states also new state here and we have a name uh name and the country d nothing else name and here i'm going to say um country and this remove this one okay change this to be states and also change this one to b state and here state country name because we are going to make a relationship here change also this to be states that did destroy and we have the id of the state and also here for the pagination of the states okay and if i save go to the browser and first thing we need to open the app dot dot php and copy the link here and paste it change this to be states and also here and there states dot index hit save come here refresh and now we have states go there namespace before cost if i open the state php state model here and okay what we have there that's factory i need to remove this one and hit save we have one more remove this okay refresh and here we are in the states we don't have any i see here we have country so in the index we have yeah yeah that's okay name and the country of the state okay now if i hit create and it doesn't we go there why is that because we need to change this to be states save come here refresh states and new state and we go to the states and create okay and in the state controller create method say we need here the all the countries so we can say counters like this country all and return the view states admin state create and add the countries here okay it's save and now in the create i'm going to copy what we have here in the subcategories copy and paste it here and change new state also here change with states index to go back create state and also here states method and we don't need the multi-part form okay we have a name and we have a country here and for each countries as a country we have the value country id and we display the country name and also here change to be country id and in the select also country id yeah image we don't need the image just the save button hit save and come here and refresh everything okay we had the state which is the economy which is one and if i go and create new one new country uk so united kingdom and uk save go to the states and new state now we have two countries and for example at london then united kingdom for the country and first we need to go to the store method and i'm going to open the terminal as always i'm going to make a request store state request okay close open that store state request authorize rule and i'm going to return the name to be required and the counter id to be required okay hit save close and now here we need to import the store state request and we can say state create and the request validated and if i open the country controller and just copy this one and paste it here change the row to be states index with message state created okay save a refresh and say london united kingdom hit save we go back in the states and now we have the message state created we have the name london and the country of the of this state is united kingdom okay now it's time to update and delete here we have the edit i'm going to work with the road model binding so state dollar sign state and here return the view state edit and also i'm going to add the countries here and the state itself and the countries is going to be like this just copy and paste it here now hit save and go to the create select all copy and go to the edit and paste and here edit changes to b edit state state index okay update state here we have the name and now we need to add the value value the state name we have a country as always and if you go here [Music] we have a categories and i'm going to copy this one option we have a value and pass it down paste it and also this one so if we have uh change this to be country so if this country id is us the state country id is going to be selected and we display the name and that's this okay hit save yeah change this a b update and hit save come here refresh everything okay go to the edit and we have the united kingdom and the name is london is london up and change the country to be united states update and we have the united states here but we created two because we don't edit the the action the route is state store instead we need to add the state update and also add the state id here and method is going to be put okay hit save go back refresh and we have the london app and i'm going to do the same thing here if i go back again yeah london update it now and choose united states again update and we go back nothing happen because in the state the update method is not going to it's not doing anything so here i'm going to import the store state request the same thing as we have in the store and here also at the road motivating here state and dollar sign state and here we can do state update the request validated and copy this one paste it here state updated hit save come here and refresh london updated and united state update state updated now and we have one okay now edit the same thing here in destroy sorry we going to work with the road model binding state dot assign state and here the state delete and return redirect with message state deleted hit save come here refresh and now if i delete this one yeah delete it and stay deleted this one okay hope you enjoy and see you in the next one friends all the best hello my friends welcome again here we are in the dashboard and now we have done with uh categories subcategories child categories countries and states and it's time to work with the cities now and if i open the vs code here first i'm going to have the table plus and in the cities table we have a state id and a name and here we have the city controller here we have the index method and i'm going to say see if this is going to be city and paginate by 12 and i'm going to return a view it's not yet created admin and then see this index and i'm going to pass the cities here so compact cities and close this one and now go to the view here uh sorry resources views admin and create new folders for the cities and here i'm going to create new files for the index delete.php new one create dot blade dot php and another one or the edit delayed php and i'm going to do the same thing i have done with the states so go to the index of the state copy all and paste in the index of the city and here we make changes so cities here the message and cities create new city here we have the name and the state and for each now with that he do for each cities as the city like this which it has the city and here we need to do see this like this okay and here as well cities anything we are done hit save also save the controller and go to the web php inside the roads okay here we add road resource and cities and here city controller and make sure we import the city controller hit save close this one and open the app lead inside the layouts and copy the link here and paste it and change this to be cities okay and the same thing here hit save this one close and go to the browser refresh now we have cities here click and we have a city go to new city and we navigate to the cities and create okay come here in the city controller we have a create method and we need a state so i'm going to say states is going to be or we can leave and add in the blade or we can do like this state and state sorry all and i can do return the view admin city create and pass the states here okay save and go to the [Music] states create blade i think we added here in the city now state create plate select all the copy and now paste in the create plate of the city and change this to be new city also here see this index and create city here see this dot store method post we have the name and the state and for each states as the state we have the value state id and then display the name here and also we need to change here the to be state id and i think we are okay hit save and now we need to also work with store request store map here open the terminal sorry open the terminal here and artisan make request store city request close this one open the store city request change the authorized be true and the rules i'm going to leave the same as always just name is going to be required you can do anything here you want and we have the state id and this one is need to be required save this on close and now in the city controller in the store request we add the store city request okay i import that one and now we can do the same thing as we did in the state controller yeah i'm going to copy this and paste it here and just change this to be city also just see this index with message city created hit save and go and try in the browser okay city for the london [Music] i'm going to say london hit save and yeah at enter you provide a name unknown if we index here and we have a city name and city state name save this refresh and now we have london and london okay i'm going to create a new state for example new york for the united states hit save and go to the city new one and now we have two okay now it's time to work with edit and here we have so i'm going to remove that we have the edit i'm going to work with road model binding so add it here the city and dollar sign city and here we need the return first i'm going to say the same thing as we did here for the state because we need the states here and i'm going to return the view admin city edit and paste the compact states okay and we have the update here the same thing as we did here just copy in the state controller and paste it here just here we can say for example uh enough for example here we need to say city and dollar sign city and also city update see this index with message city updated okay hit save and now in the i'm going to go in the edit the states and select all copy and paste in the edit cities just change edit city cities road here and update city here also we need to change the road further update method city and we need to add the city here where is the here we need to add also the city i forget okay and [Music] method post and put here we have city name and here we have states and also state here and update us okay save from here refresh and go and update this one learn them up update and what has validated does not exist because we need to say here store city request go back refresh up update and i is not updated in the edit plate yeah we need to change this to be state id and now refresh okay app update and now it's updated and if i change the don't want to be new york in the london the name london app update and now we have the new year okay and there is a time to be to work with deleted here we have also entered use remote mounting binding here so dollar sign city deleted not delete but delete and just copy this one paste it here city delete it okay save refresh and delete this one okay city deleted delete the next one and say it deleted okay that's it for this video friends hope you enjoy and see you in the next one all the best so my friends welcome again so here we are in the dashboard in the user profile so far we have done with categories we have finished subcategories child categories countries states and cities now in this video i'm going to start to work with listings and for that i'm going to open the terminal here okay i think maybe zoom yeah that's okay so first i'm going to make a model and migration artisan is a short command for php artisan okay and make make model listing dash m for migration and now the model is created successfully and also the migration okay i'm going to open this with a vs code as always i'm going to close everything here and i'm going to open the listings table and we have the default the table id and the timestamp and i have prepared this note here so in this table i'm going to add the user id feature image image 1 image 2 and image 3 so i'm going to dot 4 images here you can add how many you want so one is for the feature image and they are order image we have category id sub category d child category d title description price price negative table condition location country state id city id and phone number and publish it is published or not so open the vs code and here we go now add the double for the unsigned big integer and here i'm going to add the user id okay so we have feature image and image one image to an image three dot assign table and i'm going to add string for that feature featured image and dollar sign table string for the image one and this is going to be no level okay it's not required another one for the image two and this one is going to be no level as well another one for the image sorry string and image three okay and new level as well now we have the category id subcategory d and child category id so add the table unsign it integer okay category id another one unsigned integer for the sub category id and this is going to be no level another one for the child category d o k child sorry so i'll category id and this one is going to be no level and we have title description price and price negative so add the table for the title and it's going to be string title and for the description is going to be text it's going to be long test so description and for the price i'm going to say string and price and [Music] string for the price price like a table and table what we have now we have a condition location so table string for the condition [Music] and string for the location okay and we are going to add table sorry unsign it integer for the country id and another one inside integer for the state id and it's going to be nullable another one [Music] for the city id and this one is going to be new level and we have the phone number and publish it so here we are going to add a table for the phone number and it's going to be string number and table boolean for the publish it or is published is publish and default is going to be one or zero and it's going to change after and i think we are done if you want to add more you can add how many you want for me it's okay i'm going to save this and go and run the artisan migrate and he's going to create this one so go to the table plus database open the classified dots and we have listings here instructor and here we have and i think we have user id which image image one two three category this category and so on okay friends that's it for this video hope you enjoy and see you in the next one all the best thank you hello my friends welcome again so here we have the table of listings and i forget that [Music] the slug so i'm going to add it now a string for the slack or we can use one of the packages from spotty or another one but i'm going to add it here now hit save go to the terminal and artisan migrate fresh so here i'm going to go to the register and take builder register new user and here is the dashboard i'm going to add a menu here to go and create a new ad and i'm going to add the design the for okay so come here open the terminal and artisan make controller and i'm going to say not admin city controller but listing controller listing controller and dash resource okay close this one close this open the web php inside the roads and here i'm going to say road get and here with the say listing controller class and the method is going to be create because here i'm going to say adds create and i'm going to give it the name create like this hit save and open the up blade layout here we have the links [Music] and here we have the dashboard i'm going to copy this one and here i'm going to say new listing and i think we can add so where we have the components uplink here image class here we can add the class and by default the bg is gray 200 i'm going to say here okay i'm going to say class with a bg green 500 hit save and come here and refresh and yeah now we have this new listing and however we need to change the color so on hover the bg is going to be green 700 okay and refresh i think yeah maybe it's time to run the mpm ram dev the compiled assets and here we can add the road as well road is going to be uh adds that create the same thing here that's dot create hit save and refresh here i don't know why over bg green 700 so okay [Music] npm run watch and it's going to watch for the changes okay cool refresh go back sorry and refresh and i think maybe we need to see i'm going to fix this in the backstage okay now if i go here i want to display something and for that i'm going to go to the listing controller and when we have the create method i'm going to return a view [Music] listing dot create hit save and now go to the views new folder listings and your file a dot blade.php okay here i'm going to copy what we have in the admin and maybe in the sub categories here just select all copy and paste it here yeah hit save and refresh again we don't have the but no worry i'm going to fix that so here we have go back and it's i don't need this go back so first i'm going to remove that where we have back yeah this one new listing here and create new listing also here we can say uh arts dot store and save come here refresh yeah we don't have that ads store so the action i'm going to just change for now refresh and also i'm going to close this okay so we have the for the name but i'm going to see what we have in the table so classify that's open and listings here the structure we have use id and we have the feature image image one image to an image three okay so here we have a choose file i need to cut this one or leave it to leave and this is going to be feature or what we call that yeah featured image and copy and paste this so one two three three times and here we have feature image this is going to be image one image and image 3 okay save come here and refresh and we have the feature image image one image to an image three we have the category and subcategory in child category okay for that i'm going to use this this one so here we have a category and cut this one paste here say subcategory and also paste it here and say child category hit save and refresh and here we have category subcategory child category okay now we have title slack and description we have a name here okay the name changes to be titled we have we need to add the description and the description is going to be after the categories or maybe i'm going to leave the categories first and after that i'm going to add this one and also i'm going to say description here and change this to be text area refresh so we have okay text area and we need to close that text area here okay categories a category child title description and the image the images and now we have price price like a table okay [Music] for the price i'm going to copy this one and add it here say price and for the past negative you need to add the drop down just copy after the price add this and price here we can say for example we have a fixed price and here we have the mega double class okay refresh and we have a price and the fixed price we have the condition and it's going to be the same thing just copy this one okay [Music] condition and for example new here new and user used okay refresh new news no okay condition we have a location and location i'm going to copy what we have in the title where is the title here just copy this one and paste it here change this to be location okay we have country state and city id so we need something we have with uh this one so copy this one and any other location out of the location put that here and we have to say country and here we say country and change this to be country as well and we need to change the name and error here but we have the change for all that here is going to be state and here the city state city we have a phone number and is published or not so phone number is going to be the same thing as the title just where we have a title copy this one and paste it here phone number type number and what we have our phone number n is published it's going to be the same thing as we have here copy this on and paste it here and we have the published and we can say here value it's going to be zero and published and one for the published save and copy refresh we have category subcategory child title description price fixed or negative price condition location country state city and a phone number also not published or not and i think that's it titles and description price pressing they will come yeah that's it just i'm going to [Music] fix the names here the ids and the placeholder the error for the for the specific uh input and also um i think i'm going to remove this and i'm going to make this whole form all of uh with a form and i'm going to make maybe three column for one for the category here subcategory here and type category here and also the title here and description and i'm going to design it and i'm going to show you in the next video because it's going to take a long time so hope you enjoy and see on the next one all the best all the best hello my friends welcome again here we are in the dashboard of our application and i want to create new listing now i have made some changes so here in the web php i have changed the route to be listings create and name listings create and i have add one more for the post listing store and name it listing store okay also in the app plate i have changed the app link for the new listing intelligence things create okay and i have added this behind the scenes just uh for to be the more short video in the create blade i have added the classes and also the names here for all of our fields and i'm going to make a measure the github so you can find it the github just copy and paste if you want there and it's going to look like this so if new listings i have added them here categories i've got a great child category and for now we don't have any of them okay uh whatever have done i have created the store listings request store listing request and add the rules for the category subcategory child category title description price and all of them here also in the listing blade i have added all the fillets here and now in the listing controller i want to uh store a new listing and you see here i added the store listing request not the request itself that were what i have created and in the form also in the create blade i added in that form the action wrote listing star okay and that's it so now here we can say to create new listing i'm going to save the request for the featured image because we i'm not going to upload the image in this video it's going to be just the name featured image and copy and paste that and change here the name this is going to be the image one image one emit and this is going to be image one the image two is going to be the image to image and here image 3 is going to be the image three image okay also we need to add the slack and user id the request for the slug for now is going to be slack and the request for the user id is going to be 1 and now i'm going to say listing create and the request all for now hit save now i'm going to say redirect return and redirect to the road dashboard okay um come here and refresh uh i want to create the category click here uh for the l electronics and i choose a random file open save okay create new category and say pc category electronics and choose the random files as well and the child cut over here april subcategory pc choose a file it's safe okay and also i'm going to create new country and the united kingdom uk state london and city okay so create a city sorry i created two states with the same okay city new city here and london state is london okay now go to the new listings and we have category subcategory child category and also the country state and city okay add the title and here is the first listing description here price is going to be some random price fixed condition new location london and [Music] okay the country state and so on the phone number random number then i'm going to leave it and i'm going to hit save and we are directed to the dashboard if you go to if we go here and data refresh and we have the featured image sorry we have the user id1 and feature image image one then we added uh hardcoded we have category subcategory child category first listing is the title slug is slack description is the script desk price fixed new and that's it the published is zero so if i go and create one more and this is going to be the second listing and some random description location and so if we change this to be published hit save come here and refresh now in the second one we have the published one okay this is published this zero and published one and also i have changed if i open the list sorry listing table i i think i i changed this and i'm not sure if i said to you is published because before was is published like this and i'm changed that is published okay and migrated again the table and that's it for this video friends hope you enjoy and i'm going to add them to the github so you can go and copy from there all the best and see you in the next video hello my friends welcome again so in this video i'm going to make this uh dependent drop down with a live wire so here we have a category and if i select cars i want to display the subcategory for cars or for example here we have electronics and we have laptop and pc and i want to display the child category depended on the subcategory which was okay so i'm going to open the vs code and open the terminal let's create a livewire component and i'm going to say [Music] depended category okay and say no close this one and now open the live wire dependent drop down here dependent category here and i'm going to add a public dollar sign categories one for the sub categories okay and one more for the child public chat categories and we need one for the selected category and by default is going to be null and one more for the selected sub category and this one is going to be no and i'm going to get a method for the unmount and i'm going to say this [Music] category is going to be the category all and then need to import the category modded okay [Music] and here i'm going to create a new method for the updated selected category i'm going to say category here and if we update the category i'm going to check if is not no the select that category and i'm going to say this [Music] subcategories is going to be subcategory where category id is this category we have here and get [Music] the same thing i'm going to do for the update select that sub category and this selected subcategory now here we can say child but the course is going to be chat category where sub category id and get okay hit save and i'm going to go to the views and then we have the listings here we have the create and we have a category here i'm going to copy this one also the sub category here and the child and cut this one and i'm going to create new the thief here with the glass grid grid call 6 and gap 6 and here i'm going to add the live wire and the name is dependent drop down no that's where i have live wire here and dependent category not drop down but category hit save and open now this one depended category and select all and paste this one hit save we need one more div and if i save and come here refresh yeah we have this so i think we need to go to create and copy this one here paste in this div and save and now here we can say we can remove this thing okay hit save and refresh yeah now is we are okay so here we have the same thing and now i want to when we click in the dependent in the category here select i'm going to add wire model and it's going to be selected category and for that we have all the categories here now in the next one we need to say wire model for the selected sub category and we have the sub categories here and the last one is for the child categories okay but we have a narrowly very fresh now because we don't have categories and they make arrays here hit save and depended the categories mode okay save and refresh now is the next category subcategories because we not updated the category so the subcategory is empty for that we need to make and check if we have a sub or if we have a category selected category so this one we need to add if is not known the category cup and paste it here and if i save now we have the child category error oh yeah selected a category like this and now we have the chart categories what i said and i'm going to do the same thing for that so if it's not not the selected sub category we need to pass this here and save refresh now we have only the electronics here you see we don't have we don't show the others so if i select cars we don't have any but we show the subcategory if i select solder electronics we have a subcategory for pc and laptop and if i choose laptop we display the child category and we don't have any child category for laptop so here i have categories a new one name it and i see this for a laptop child category we need hp but i'm gonna say and some random image go here and select electronics pc laptop and we have hp here if i select pc now we have able okay friends this is how we can make a dependent down in the next video i'm going to do the same thing for the country state and city hope you enjoy and see you in the next one all the best hello my friends welcome again so in the previous video i have fixed this uh dependent drop down for the categories in this video i'm going to do the same thing for the country state and city okay so here in the vs code i'm going to open the terminal and artisan make a dive wire component and call it independent country okay close this one and i'm going to copy what we have here in the category and paste it in the country sorry okay and now i need to make some changes here i'm going to say the country and select it country here and name is country id and also here we need to say [Music] countries [Music] as a country okay and the same thing here now selected country if we have a selected country we need to add the state okay and here for each states assessed state and here we can say state id okay and this here we can say selected state okay now selected state here and selected state we can display the city okay and here to see this class city and here city id [Music] also here [Music] and i think we are okay hit save and go to dependent category here i'm going to copy all almost all and open the country and paste it here here we will say countries states and cities selected [Music] country selected [Music] state and first we need to associate the countries with uh [Music] country all and updated selected [Music] country and here we had country itself this selected country and this states with a state where country d [Music] is this country and get and here selected state [Music] and we paste we pass this state here and select that state here it is we associate the cities now see this and [Music] city where state id is the state we have here status country and i think we are okay hit save and open the okay where we have these things and create and we added the [Music] category here before the here we have a feature image second another image and the save button but i want to remove the categories yeah country the state and the city and i'm going to add them after the phone number i'm going to add them here so livewire and here we just say depended [Music] country hit save [Music] and come here and refresh and [Music] select that country i have a mistake in the dependent counter blade depended contribute is selected country so here we have selected country like this hit save and refresh and now yeah you see here we have only the counter displayed and we have only one country okay go to the countries and create new one i'm gonna say uk us [Music] and create that one in the state now we have london i'm going to create new state [Music] new york and in the usa country and in the cities i'm going to be a new city new york or new york okay go to the new listings and choose usa but selected country again okay selected country it is on the selected country where is the select that country now property selected country not found in component yeah here we have we had wire modded and we need that okay here and now we have new state and is new europe so if i change this to united kingdom now we have london here and the city is london if i change usa now we have new york and city is new york okay friends so that's it how we can do the independent drop down for the country hope you enjoy and see you in the next one all the best friends hello my friends welcome again we are in the dashboard and in the listing slash create we have the form here the dropdowns and here we have a file if we choose a file now we display that [Music] name but i want to preview the image also and for that i'm going to use the live wire if you go to the livewire website in the documentation and here we have file uploads and we have the temporary preview urls okay i'm going to do the same thing so here in the vs code open the terminal and i'm going to make a live wire component name it image preview okay and open the image preview blade and also i'm going to open the image preview class and here i'm going to use with file uploads and i'm going to create a property for the dollar sign feature image one and another one for the image one another one for the image two and another one for the image three okay hit save and open the image preview blade and also the listing create create play it in the listings and i'm going to copy [Music] the div for the feature image image 1 image 2 and image 3. copy them cut sorry and i'm going to paste it here okay hit save and now in the create i'm going to add that component here so live wire and image preview okay save this one go to the website refresh and here is the component and i display that name but not the file not previewing the file now and for that i'm going to do come here and in the input i'm going to add the wire model and here the name of the we added in the image preview class okay feature image so here this i'm going to open in the right and this in the left so here we have feature image and here and without featured image uh copy this one and add in the input of the image one just change the this would be image one so this property another one in the image two and change this would be image two and this one image three oh okay image three okay and now we i want to display the previous image and i'm going to copy this here and i'm going to add before the input so if i put it here and now change this to be feature image so like this and hit save refresh choose file open and now we have the preview of the image but you need some we need some style and i'm going to say sorry if we have an image i'm going to say div and class of margin 2 and padding 2 and maybe width is going to be 36 and hit the same thing and i'm going to say around it okay and add the image here save this one refresh choose file open and okay but maybe change this a bit 32 no it's very small why is 32 very small okay uh we need to run the npm run watch to watch for our changes in the css file okay and now refresh open this one and yeah okay i'll remove this and i'm going to add the glass here the width is going to be 36 and 8 36 and round it okay save this one refresh open and yeah now we have 36 and it's rounded but maybe more small not 36 but 8 20 24 okay open and why it's not change the image i think is the same okay uh yeah as change and go to the titan css.com search for hate and here we have 24 yeah or 28 so if i change 9 to 28 the same thing for that save and come here and refresh yeah i think maybe it's okay and i need to do the same thing for the other images so copy this and put it here just change this to be image you one okay copy and paste it for the image too and change the property to image two and for the last one copy and paste for the image three and do the same thing hit save come here and refresh and select the feature image okay the feature image is here image one okay i image show image three yeah and we can change the name here photo preview just say for example here image 3 preview or don't give the name if you want because ms3 is here and if you want uh you can add css classes to move this in the end here okay for that we can you can find in the tiling css what you need to do okay and for i think we are okay for this video we just uh preview the images and now we need to save the listing in the next video we are going to save a listing and start with the update and delete that hope you enjoy and see you in the next video all the best friends hello my friends welcome again in this video i want to store the new listing and i have opened the listing controller here we have the store method and in the previous video i have made this uh other feature image feature image string and for image one the image one image string also the same thing for the image 2 and image 3 and in the slack i had the slack string and it was in the user id i have added the one and i've created with the request all now i want uh add the real data from the request and the user id i'm going to add the authenticated user id okay here we are now in the listing controller i have added the feature image to be image and a new label the same thing for image 1 image 2 and image 3. ok i'm going to remove this one and here i'm going to say the or the feature image is going to be the request file feature image store in the public and listings folder copy and do the same thing for the others just change this to be image one this one to be image 2 and last to be image 3 okay uh in the request i'm going to do to be required okay and close this one i'm going to do the user id here now so the request or no i'm going to do another thing here i'm going to add the array and here i'm going to say the user id is going to be the auth user id uh that tag or the id is going to be the request category id and copy and paste for the sub category subcategory id and this one for the child category id okay now her title add the title and the request title also the slug is going to be str slug and the request title and we need to import the str here okay illuminate support str uh description it's going to be the request description okay what we have i'm going to open the structure here we have the feature image and so on category title slug description price price negative table condition location okay so here at the price and it's going to be the request price uh price negative table and it's going to be the request price negative table okay uh location is going to be the request location and condition is going to be the request condition okay country state and city id phone number and is published i'm going to say phone number the request phone number and is published is going to be the request is published and now i'm going to add the country id request country id copy and paste this one and here add the city id and state id and i think we are done now if i save oh yeah no we are not done we need to add the images so here are the featured image which is going to be the feature image we add here so here we have the path of this file i'm going to copy and paste this one and change this with the image one image three and the last one in oh sorry this is the image three and this one is the image show image to hit save and come here refresh and we need to try now add categories okay okay okay choose the country state and city choose a file i'm going to choose another file here this one choose new one image two and image three okay hit save and call the member function in the request file featured image okay this one is because we need to say featured image here not feature image hit save here and refresh okay featured image maybe we need to go back and refresh here fake filler we need to choose electronics also we need to choose and the files here click another one open another one another one okay hit save and the price nega table does have the why is that price negative okay never table and the same thing here refresh continue and we are directed back to the dashboard and if i go here data refresh and here we have the user id which is seven the feature image path image one image two image three category sub category id child title slug description price and so on this is how we can store data so i'm going to create new one now okay fake filler again and here i'm going to say laptop because we have child category i want to say pc enabled okay uh usa and again downtown we need to fix this one because if i have the united kingdom we need to have another one for the the united kingdom and choose here between okay but in the behind the scenes i'm going to fix that open this again another one open okay and the last one here and hit save we redirected back go to the table plus refresh we have now the user id which is 7 again we have a feature image and image one image two miss three okay title and so on hope you enjoy friends and see you in the next one all the best hello my friends welcome again in this video i'm going to display all the user listings so for example this user i'm going to display the listings here and i'm going to add the menu for the my listings okay in the vs code here i am in the upblate.php in the layouts and we have a new listing here i'm going to copy this one and add it here and say my listings and in the road web php i'm going to say road get and these things here i'm going to add the listing controller and the method is going to be the index method i'm going to add the middleware house and the name is going to be the listings dot index okay it's safe close now this one and here change this to be index okay come here and refresh and now we have my listings and for now we don't have anything because in the listing controller in the index method we don't do anything and i'm going to do is go to the listings and in the create new file index.later.php okay and here i'm going to say our listings is going to be listing where the user id out user id get and the return the view listings index and compact listings okay hit save now i'm going to go in the admin and when we have the index for the categories i'm going to copy all of them close and come here to the index and paste it here and we have let me change this to be my listings and new listing and go to the listings.create and for each listings as listing okay and i'm going to display the title of the listing the slack listing feature image okay and here i don't have we don't have listing edit so i'm going to leave it for now with the categories or yeah i'm going to leave with the categories and again here listings and hit save come here and refresh compact on the final like we have a typo here compact listings and i was here we can say okay and in the index i'm going to remove this for now and refresh here we don't have any listings go and create new one okay a fake filler here i'm going to change this to be my first at least thing and change the country okay choose a file and this is for the feature image this is going to be image one image show and image three hit save and go to the my listing now and here is my listing okay friends this is the slug the image and here we have the edit and delete but we need in the web php to add copy and paste get listings or maybe is the better than other resource so wrote resource for the listings listings controller class and just i'm going to say here middleware out for all of them hit save come here and refresh everything is okay go to the new listings yeah and now we need to fix the edit and delete in the next video all the best friends see you in the next one thank you very much hello my friends so welcome again in this video i'm going to make the edit of the listings so here we are in the dashboard and if i click my listing i don't have any because i have new user here go to the new listings and create one okay choose that one fake filter and state city okay feature image open image one image two 3 and hit that save okay save [Music] and we go to the dashboard now my listings and we have my listing and by the way i'm going to make a change sorry i have not opened the terminal cd the level and cd to the classified ads open with with code okay and when we create a new restore new listing i'm going to redirect the road of listings index okay listings dot index hit save and create new one because i want to redirect the user to the listings here okay new listings fake filler and laptop oh okay london london choose file again just for okay open last one and save and now we adapt our listings okay now i want to click here and go to the edit and i did update this listing okay so here we are in the index of our listings and we have the edit yeah here we have edit and this is going to be the listings dot edit okay save come here refresh and click the edit button and we go to the listings listing id and edit and for that is a responsible edit a method here i'm going to use the id okay i believe that and i'm going to say the listings the listing is going to be listing or or find the id and return the view and we don't have that view just we need to create that so listings dot edit hit save and now go to the views when we have a listings here create new file edit.blade.php edit dot blade dot php okay and copy all from the create and paste it here now here i'm going to say edit listing edit listings and method is going to be the route is going to be update and we need to add the listing here and by the way i forget past here the listing so compact and add the listing hit okay listing okay go to the edit and here we need to add the id so listing and id and here we need to add the method put got now here we have a title and i'm not add in the placeholder now i'm going to add the value and the value is going to be the listing title okay the description is going to be here the listing description okay what we have we have price and add it here so the listing price and we have here we have a price level table and so here i'm going to say if the listing price negative table is and what we have this option here i don't know okay so if the price is fixed fix it this is going to be selected other ways it's going to be an empty string and i'm going to copy this one and paste it here just change this one here okay condition the same thing for condition sorry i'm going to copy this one here and paste it just add the condition not and if this is new it don't be selected or if this is used it's going to be selected okay now location added here the value and the listing location okay phone number same thing okay i'll just add the last sign here and we need to add the same thing the value sorry this is zero is going to be selected and if this is one it's going to be selected and i think we are okay change this to be update i'm going to hit the save now and go back refresh this one and we have the title we have a description here we have we don't have the price but we have the condition which is used and i'm going to see if this is used okay so i'm going to open the table plus okay and classified ads listings and i think is the last or yeah this one then this one is yeah it's used condition is used okay but the price is missing and i don't know why we have the price price okay price yes at least listing price but okay sorry friends i just had listing price here not in the value so cut this and add value and now add the price okay refresh and now we have a price a phone number okay published and where is the phone number condition for number location here is here and the same thing for the phone number just cut out the value okay and the refresh and we have a phone number and i think yeah we have all the other values of okay now in the next video we need to update the display the category subcategory in child category and the same thing for the country and state and city and i want to display the images we have choose here so display the images and if we want we can update them choose one another one okay hope you enjoyed this one and see you in the next one very soon all the best hello my friends welcome again so here we are in the edit form of our listings and i want to fix the category subcategory and child category also the country state and city and i want to display all the images we have so the feature image image one image two and an image three and if we see here the image and if we don't like we change okay if i go to the vs code and in the viewers here listing and in the edit so here we have the dependent category live wire component and here we have the dependent category i want to create a new one so in the vs in the terminal i'm going to say artisan make live wire component and i'm going to name it dependent sorry dependent edit category and also the country depended edit a country okay i want to clear this and go here and now i'm going to copy all we have in the dependent category and paste it in the dependent edit category okay hit save and also i'm going i need to open the livewire depended category and copy this one and now open the dependent edit category and paste this okay import import and also the child import okay so we have the category subcategory intel categories we have the selected category and subcategory and we when we update the category id here we also showed the subcategory but in the edit form we have the category id so we need to say so i'm going to add the cut tag over here also the sub category sub category and a child category okay and when we start here when we mount the component these categories is going to be category hole and also the selected this selected category is going to be with the category here and the this sub categories is going to be the same thing we have here subcategory and get oh okay because we have the category here and this child now this select selected subcategory is going to be the sub category and also this child categories is going to be we where subcategory d is this the sub category we have here so we added the category sub categories and also the and i'm going to add it here the public sorry public and dollar sign selected child category and it's not going to be no i'm going to remove this okay we don't need now then yeah we need because if we make a change we're going to update so i'm going to add the last one this selected child category is going to be this sorry the child category and i think we are okay go here option value category d and now we need to say if the category id is [Music] equal with uh this is for the sub categories okay so if this is for the selected sub category selected sub category is going to be selected otherwise nothing and the same thing here if this is going to be selected category and here the same thing selected child category if i save now and one more thing we need to go in the listing edit and here depended edit category and we need to add the properties here okay so we have the categories of category and child category so here we need to add the category which is the listing category id and the sub category which is the listing sub category id and also the child category which is the listing also a child category id okay save this and now refresh and depended edit category unable to find component and this is dependent edit category y yeah dependent oh depend that like this okay refresh and you see here we have the the electronics laptop and hp and if i go to the table plus and open the and classified ads okay uh listings the last one the last one has the category with id1 subcategory with id 2 and the child category with id 2 which is so category 1 and subcategory 2 and child category 2 category 1 is electronics and in our case is electronics okay now sub categories is two which is laptop and yes and chat categories to its hp and yeah it's sp but the problem is here because we have only one child category and we don't have all the child so in the dependent category here so child categories is going to be child category d is this subcategory and get so why we don't have all the child categories and depended if selected subcategory ok where is the chat if it's not known the selectors have a here we have a child categories and i'm going to say display the child category is here let's see what we have refresh and we have only the hp so why we have only the hp and we have we don't have all the child categories we're somebody get so if i select now and also and we again have we have only one i'm going to fix this and see you in the next one friends hello my friends welcome again so i need to fix the drop down dependent drop down because if i select now we lost the selected category and we have the child category here selected we if we select cars we need to clear the child category and also we need to show for example electronics yeah we have two and for that if i go in the dependent edit category here we need to remove this line of code because we are working with a wire model and for that we lost the selected category also the same thing for the sub categories and the same thing for the child hit save and come here and refresh okay now if i select cars yeah we have cars here and electronics of course we have electronics now and we have subcategory okay uh this one thing i want is to clear when we change the category i want to clear the child category and for that we need to go in the dependent edit category class so here when we updated the select the selected category i want to clear so this reset the selected subcategory and also the selected child category and the child categories so child categories okay it's save come here and refresh and now if i select cars and okay cut the gory like this refresh again select and yeah we have clear the child categories and if i select electronics okay laptop and now we display the child category i'm going to do the same thing for the country so open the dependent country and copy from here in the dependent edit country and paste it here we need to import that import state and import the city okay we selected country selected state and also the sorry selected city and it's going to be node here we can add the sorry a dollar sign country dollar sign state and dollar sign city and in the edit php when we have the independent country i'm going to say dependent edit country okay edit country and we can we need to add the country dollar sign listing country id state is going to be dollar sign listing state id and city is going to be a dollar sign listing city id okay hit save and go to depended edit country and now here we can do the same thing we have with a category so this selected country is going to be with the country we have here and this selected state it's going to be with the state that we have and also the city at this selected city with the city okay also the states sorry this states is going to be i'm going to copy this one and paste it here where countries the country we have here and the same thing for the city okay so state we have here and i'm going to save this come here and refresh and we don't have the city any city here depend that edit country country state and city okay why we don't have any first i'm going to remove that so in the independent edit category remove this demo remove this and also this one save and refresh okay but we don't have the cities and dependent edit country here okay so we need to go to the dependent country select all and paste it here save and come here and refresh and now we have the country okay so for this one is uh united kingdom london and london okay so if i go to the table plus and classified as open listings the last one is this one and here we have the country d1 straight id1 and ctid1 and the country with id one is uk okay and we have the uk the state with id1 is london and we have london and also the cd with id1 is done okay friends so this was for this video in the next video i'm going to display the feature image and update the the category sorry the listing we finished that and we need to make the admin to separate the admin and the profile user profile because we don't need to show the categories subcategory uh child and modify the user all the things but only the admin okay hope you enjoy and see you in the next one all the best thank you hello my friends welcome again in this video i want to fix the images so here we are here the category and we display the category if i choose cars okay we clean the subcategory and child category okay so electronics now we have pc and laptops the same thing for the country usa and i see here the country so dependent edit country we need to say the same thing as the category here we need to reset on the updated country select the countries of this reset and we need to reset here the selected state and selected city also states and city let's cities because state is here it's changed we associated with the state from this country okay so hit save and now refresh if i choose usa yeah we clean up okay now it's time to work with the images and open the terminal and i'm going to create a new livewire component called it name it edit image preview okay and i'm going to copy what we have in the e image preview and paste it in the edit image preview import with file uploads okay and also the same thing for the [Music] image preview blade i'm going to select all copy and paste in the edit image preview hit save now in the edit image preview class i want to create the same thing we have here but for the old one so and i need select all and say alt and here the feature image okay now we have all featured image alt image one image on ms3 so this old feature image is mean the feature image three the listing has okay in this case what image we have is going to be the all the image and the the feature image here is going to be the what we choose here okay this one so i'm going to say here if first i'm going to change this one and edit image preview i'm going to add this one and here we need to add the old feature image which is going to be the listing feature image okay now the old image one is going to be the listing no sorry listing image one and old image to the same thing so the listing image 2 and the last one the old image three is going to be the listing image three okay save this one and now in the edit image preview class we need to create a method here for the mode and we need that old feature image okay and that's his this one and here we need all right old featured image okay image one alt image one altimeter and a whole image three okay so dollar sign old image one the last line hold image two and alt image three okay now this old feature image is going to be the old feature image we have here and the same thing for the old image one the old image one this ultimate 2 with old image show and this old image 3 with old image 3. okay hit save come here and now first in the edit image preview if we have a feature image we display here and this is going to be the new photo feature new featured image and i'm going to display let's say here a div and cut it here paste one and paste this one and here i'm going to say if we have old featured image and the source is going to be [Applause] storage url storage url and the old featured image okay if i save and come here and refresh now this is just image and new featured image okay but not new this is going to be old so this is going to be deep with a glass with full and flex okay and here is going to be flex as well if i save and refresh now we have this this is the old featured image we need more style but for now and if i choose new file now open this is new feature image okay this is old and this is new and if i search for a new laraveled image because i think it's not very nice that one so i'm going to download this one save image okay refresh and uh this one yeah now this is the new featured image and i'm going to do the same thing for the rest so copy this one here we need to paste it here just change this to be old image one and the same thing here image one okay here we have the image to hold image 2 and the same thing here image 2 and we need to change the text as well hold image 2 and here sorry this is the image two and this is the image one okay now we have the for the image three okay change this to be old image three and image three like this save come here and refresh and now they have we have all the image all feature image image 1 image 2 and image 3 choose new for the ultimate 2 and i'm going to choose this one and yeah we have new image too okay [Music] now in the con listing controller we have the update method and i'm going to copy this one and paste it here now we have the listing here and also i'm going to add not a request but store listing request so the request we have here and the same thing i'm going to do is just copy this one and paste it here just this is going to be dollar sign listing update and it's going to update the not the user id but the category id with the request category and so on the image now here is some we need to make some changes so first we are going to check if the request has has fired for the featured image uh cut this and paste it here because first we need to say the feature image is going to be the listing feature image okay so this image here is going to be the listing feature image and if we have a new file we're going to update the things the url and the same thing for the image one just we need to change this is going to be image one this image 2 and this image 3 okay and the same thing here just copy and paste change this to be image one the next to be image three and sorry image two and this one image three hit save so we instantiated the feature image with the listing feature image the same thing for the image one image 2 and image 3 and we if we have a new file for that we updated the images yeah we save come here and refresh and first i'm going to update the title so update hit update and nothing happen and then dump the request okay refresh and now if i hit update okay so i'm going to say the request because if i hit update now yeah because the store request has started listing request has the image one to be required okay now come here and remove the dye and dump to see if we can update the title save refresh here go back yeah update it and hit update we go refresh and yeah this is updated now i want to change the old feature image choose new file and select this one open hit update okay and go back to edit and yeah we change the image okay friends hope you enjoy and see you in the next one all the best thank you very much hello friends in this video i want to install the laravel permission package from the spotty team and that's because here we have every user who is going to register and go to the dashboard we have this menu with a new listing my listings teleport and category subcategory child and other links but if the user is not admin i want to hide the last links i want to show only the new listing my listings and the dashboard and also the profile and logout if the user is admin i want to show this okay so here we are in the spati.b website and in the level permission you go to the installation in that and need to copy this command compose require spotty slash laravel dash permission and go to the terminal and paste that okay i have done that one you can add the provider by running this php artisan vendor publish and as a provider here run the artisan optimize clear or config clear and the last php artisan migrate and it's going to create a table for the model has permission model has roles role has permission and the role stable and you can create rows with artisan command php artisan permission create a role and give the name or permission create permission and leave the name in my case i have created two roles and if you go if i go here in the roles i have the admin and user role okay and now i want to hide them from the user who isn't the is not admin and if i go to the users i have five user and if my code of the model has roles i have two so one is the row id of one and the row id one is the admin okay so the role id one is attached to the user model with id2 and the user model with id2 is the alexander patrick and another one to the user with id3 okay now i have the better washington and this is not the admin so if i go here and user has the idf 5 so this is not admin and if i want to hide them it will go to the documentation here and search for blade directives here we can again and give it the name or if how the user can edit and some other condition or with their own and for i'm going to use that one road so come here and open the what we have i think up blade.php update.php yeah we have the new listing my listings and the dashboard now i want to display the other links only if the user has the admin role for that we need that the role and the name of the role which is admin and here i want to and roll and load save come here and refresh so cut the undefined method because we don't have add the robot has roles in the user class so go to the basic usage and here we need to add the use has roles in the user class okay come here and go to the user model class and add the use as roles and you need to import the spati permission traits as a rolled here save this one close and refresh and you see the user has not permission and it's not showing the other links if the user has the permission i'm going to give the reducer the permission of the role of admin so here we have using permission bros assign role to the user and give the name okay come here and open the app in the web php a web php for your web php in the roads and here we have the dive board i'm going to add it here our user and assign road and give it a name in our case is admin hit save and come here refresh and now we have the links because this user now is admin so the better washington is admin because you've got what it has roles now we have another one so road id one which is admin has is associated with the model 85 in the user which is the better washington one more thing i want to show you is if you go to using middleware and for example in the here you can say on middleware admin only admin can [Music] go here target class admin does not exist because we need to go sorry go here and copy the role permission and roll or permission copy that and open the kernel php here again in the app php and paste them to the road protect that road middleware hit save close this one and now we can say here uh road admin now like this and save refresh and because his admin he can go here but if i log out and resist a new user which is not a it's not going to be sorry here we need to go in the web php and remove this assign load okay now he's not going to be admin so he redirects back to the dashboard but we have a message a user does not have the right roles okay come here and remove the road admin hit save refresh and now he has the access to the dashboard but we are not displaying the links okay friends hope you enjoy and see you in the next video all the best hello friends in this video i want to fix the delete button here and also i want to display the message when we create update or delete a listing okay so i'm going to go in the vs code and here we have the index blade php which is this one and here we have if we have a session message we display the div with class bg indigo 600 text gray and the message and if i go here we have the store method and we're at return redirect to the road and i'm going to say with message and i'm going to say a listing created successfully okay i'm going to save this and go back here new listing and i'm going to use fake filler just update the categories here and country state and city also choose the files open image 2 and the image 3 okay save and now we have a listing created successfully you can choose a caller you can choose the text the position of the text you need to use the tiling css okay so here we have div with uh text gray and text center so if we remove that the text is going to be in the left i'm going to leave because i want in the middle the center okay now i want to fix for the update because if i update now so here i'm going to say updated and update we we are not redirecting we go back and yes it's updated but first we are not redirecting back so in the update method here yeah we are not redirecting so i'm going to copy what we have here and it here but just change this listing update it successfully okay save this and go and edit again remove or just say update it again and hit update and now listing updated successfully okay now i want to delete so if i click delete nothing happens for now okay so refresh yeah we have two listings but here we have the destroy method i'm going to say the listing is going to be listing find or fail the id and before we delete the listing we need to delete also the images of the listing so in our case the listing has four images one two three four we need to delete them and if i go in the storage and here we have a listings file in the app public listing we have one two three four five six seven eight files because we have two listings and if we delete we need to have only four okay so here i'm going to say storage delete and delete the listing feature image also copy and paste for the image one for the image 2 and for the image 3. we need to import the storage okay after we delete the files we delete the listing itself listing delete and i'm going to copy this one now and paste it here with a message listing deleted successfully okay i'm going to refresh and hit delete and listing deleted successfully now we have only one listing and we go here and in the listings directory we have only four files if i delete the listing again and we don't have any files here we delete all the files okay hope you enjoy the enjoy the video and see you in the next one of the best thank you very much hello friends in this video i want to install the laravel query builder package from the spotty i want to install that package because here we have a search form and i'm going to filter them by four fields okay and i'm going to show you if you go to the documentation and query builder here you can see check for all the quality is used and in the github search for level query builder and by spotty and here it is okay so it's selection just copy this one go to the terminal and paste that one hit enter and it's okay run the php artisan vendor published and here is the config file of query builder we have a parameters for include filter sort fields and append okay and here we have filtering and sorting so filter hello filters and name and email okay i'm going to come here and you know i will display the categories and some feature ads and i'm going to come here and go the roads web php i'm going to open the tablenet here and make make controller front end at least thing controller okay close this one and now here i'm going to say the road i'm going to register a new road get listings so it's going to get all the listings and i'm going to say the listing controller from the front end okay class and the method is going to be index i'm going to give it a name all dot listings for all these things like this hit save and i will okay i update one more we'll clean the resources views we have a listing so i'm going to create a new folder for the front end and a new file called it all listings dot blade dot ph php okay and i'm going to copy what we have in the welcome and paste it here i'm going to save and if i go now all listings [Music] yeah we don't have the listing controller index so we need to go to the listing controller index in the front end create a method for the index we are going to need the request dollar sign request and for now i'm going to say listings listing hold and return view front end all listings hit save and come here and refresh now oh yeah we need to import that save and refresh and yeah we have this one just i want to make some changes here now in the listings we have a header which is going to be this one i think and the section with these two i'm going to remove and refresh yeah here i'm going to display all the distance and if i go in the tilings here or italian dui advent ui a tryout and i think we have some yeah like this or this one i'm going to see if we have some yeah i'm going to copy this one code and i'm going to copy this one now okay and if i come here and paste this save go to refresh and why we have the html copy and remove section div for now just in the section i'm going to say class of margin two and party two and now save this go back refresh and yeah we have the same thing ivy i don't know why we don't have the same thing we have here and we have only the four pages so i'm going to go in the time blocks blocks white templates or concrete's here now let me check this one again and content yeah here we have the commerce if you code i'm going to copy this one and come here and paste it hit save and refresh yeah now we have the grid with some images fake images category title and the price okay here i want to make some changes and in the header so we have the x main header in the components mind header we have enough and also the mind arrow which is this one and the text here enter text here and so on this one is going to be so the first one is going to be for the title okay the next one is going to be a drop down so here the title category country and here the max price i'm going to say so in the end is going to be price or max max price here and [Music] here i'm going to say select an option countries i'm going to add the class what we have here and i'm going to say to see what we have so at the class and save come here and refresh yeah here we have countries max price title and here is going to be max with full okay the same thing for the not countries but categories save and refresh so here we have a title categories countries and the max price and we're going to search by that and if so we have a search button but we don't have a form i don't see the form here so i'm going to say here are the four and i'm going to close the form here and if i save a refresh okay now i can i'm going to remove the with full bg center and this one margin four and pattern four and the style is going to be removed okay save and come here refresh just [Music] i won't anymore again this div so here leave one deep here and save refresh or i want to leave that maybe it's safe and yeah i think it's more cool just remove the pg hit save and yeah now it's more okay so here is the all these things in the next video i'm going to make this work with the spotty filtering so and here we are going to display all the listings i'm going to create some random listings so see you in the next video all the best friends hello friends so here in this video i want to make a filter with a laravel query builder from the spotty team i have installed in the previous video so in this video i want to make a filter and here in the listings if i go to the vs code i have the form here which has the title and the categories countries and max price but categories is hard-coded countries hard-coded and i'm going to change this to b filter and also here i display i make a for each for the listings and in the listing controller just at the listing where is published is true and got and for now we have only one so here i'm going to say the listing category name and here the title of the listing the listing title and if i save and come here and refresh and we don't have the listing category name okay where we have the categories yeah but i think we don't have the in the listing controller model yeah we don't have relationships so i'm going to create that method listing sorry category and here i'm going to say return dollar sign list belong to the category class and one more for the country so method here sorry method for the country and do the same thing dollar sign this and we need to return first return the last sign is this belong to the country class hit save and go to the browser refresh and now yeah countries electronics and we have the title here and if you go here we have two listings but one listing has is published to zero for that we have only one so if i change this to be one and now refresh okay i think is published we need to change here yeah hit save and refresh now we have two and this is the title and this is the title this is the uh category okay now i'm going to filter for that and here we have query builder for the class and we allow filter for the fields so i'm going to copy this one go to the vs code and then in the listing controller here i'm going to say query builder for the listing model and a load filters for the title okay and hit save go here and refresh and yeah we have the same thing but if i filter but for title and so come here and add not like this but like this filter for the title and then yeah hit enter and now we have only one if i copy this and say filter i thought nostrum now we have only the most another listing but [Music] here in the all listing blade i have a form and we have a title here we have a categories and i'm going to say for each category all as category and option the value is going to be the categories and here we display the category name okay save this one and refresh yes here we need to say up models and categories save refresh yeah here we have a electronics and cars and the same thing for the country now copy this one and here when we have countries just change this to be country and also this country hit save from here and refresh and now we have countries and in the listing controller if you go to the filter and here we can specify for the exact filter and we need the exact for the id for the country id and the listing id okay so copy this one and here we can say exact for the country and the same thing for the category id hit save come here and refresh everything is okay now if i say here and filter for category id where the id is one we don't have any the way that because here we have the nozzle has the category id2 but the venue has a category in one and so if i change the title here in the browser to filter title and add this one which the category is id is one if i hit enter yeah we have this one and the country d is one also so again here we can say and filter for the country id which is one again we have that one if i change this to b2 okay we need to fix this and here we don't have now but if i change back to one yeah we have the exact one and how we can make happen to add this url because if we make a get request before we don't the level don't leave the array syntax here so for that we need to use javascript and i have prepared something for you so here we have a script and function filter results let's have our listings and var title document get element by id title and get the value so here input with name title and id title and here we give the title length so if we have a title the shaft is going to be plus filter title and the title and i'm going to do the same thing for the categories and countries so id country and here the id category and here we can see i'm going to copy this one and paste again and now of our country for the country also that is for the category and here category okay so if the category dot length and i'm going to say the shaft is going to be plus and the filter category id equal sign plus the category and i'm going to copy this and do the same thing for the country okay and i think we are okay so if i hit save and document get element by the filter out event listener click so we have i have a filter a button type button and the id filter so i'm going to make a fake click here just to make happen for this url okay go back and i'm going to say copy this one and paste it here and hit filter and now we have a filter venom and [Music] i think we need to have our country doubling it and we get the because we have this one but if i change remove this and also this hit save and go back refresh okay copy and paste this and now yeah we have the filter title venue filter category d which is one and if i change this to cars and hit filter and give the category d2 and hit the country d1 if i choose this to be one yeah we have one okay friends hope you enjoy if i remove this yeah we have two and if i you select the kingdom and feel the category id is one and fifth category two okay maybe this two yeah and this two but the way we show this anchor this yeah well now we have this one okay hope you enjoy friends and see you in the next one hello friends in this video i want to fix the filter for the max price and also i want to add this the filter in the home page because now we have a filter here but we don't do anything we just make a get request it was a listing road with a title so we need to go to vs code and first of all i want that in the home page the filter so for that if you go in the views and listings here we have the header i'm going to copy that copy the header and paste that in the mind hero so select all here and paste that one hit save and now in the listings we remove that header and pass the component mine hero so x mine hero hit save and [Music] refresh now in the home page we have the categories here but we don't have the javascript for that i need to cut this from the listings and hit save and i'm going to put in the mind layout so in the layouts my layout here after the live level scripts i'm going to add that hit save and refresh if i make a filter now yeah we navigate to the listings road with the filter category id and country id i choose category d2 and yeah but if i choose one and two okay we have one goal now we need to add the max price here for that first we need to go in the mine layout sorry in the my hero first here we have a price and i'm going to add id for the max price and i'm going to add the name as well max price sit save close this one and in the mind layout we need make a var for the max price and get element by id max price again and the same thing just copy paste that leave the max price length and here we can say max price uh max price like this if you go to the [Music] spotty laravel query builder filter and scope filters okay here we have so we need to create something like that in our model so in the listing wonder in our case open the listing model and i'm going to paste that in make sure you import the builder here and just need the max price here and i'm going to say max price but not in the carbon just like this and where you were price is smaller than max price okay and we can add in the alloyed filters right so copy and we need to go listen controller and add it here i'm going to separate that and here we can say max price hit save and refresh okay if i type the price and filter max price oh yeah in realistic i need that perfect price then the refresh and now put the price 1 000 and nothing happened so first i'm going to remove that selected category and country so in the front end and my hero i'm going to make an option for the selected with with the value nothing and i'm going to say choose the same thing for the category hit save and come here and refresh and now if i filter yeah we have all of all listings because we don't have any filter but if i choose electronics filter yeah we have that filter if i choose the max price now filter and why we don't add the max price i don't see why max price and nothing happen if i put the max price my layout okay yeah we need to change this to be max price save and refresh again put the max price and yeah we have the max price now if i choose for the category if i search by title and so if i search for title then this now has the nostrom has the category with id of with id 2 and i choose light d1 filter we don't have any but if i put that in with it one with a d2 sorry and now we display that okay the max price is where price smaller than the max price so why we don't display that we need to display all the fields that is smaller than 1000 so if i put yeah nothing happen and choose this value and we have only that linear if i choose this value now we have two but we have the venue and nostrom but if i choose five yeah now we have three [Music] but why we if we have 1000 i'm going to see that so i think we make a for the filter to look good so if i go and filter now we go back to the old listings with without any filter because we don't choose any if i choose only the category and i'm going to say here tools or categories better so if i go in the mind hero here in we have a category i'm going to say categories and here the countries save and refresh now here we can select the country and filter only by the country okay hope you enjoy your friends and see you in the next one all the best hello friends so in the last video we fixed the filters and if i filter by electronics yeah we have only two if i filter by cars we have only one if i filter by country and so on now in this video first i'm going to fix the link here for all odds and i'm logging us the travis queen and i want to click there and go in the dashboard so i'm going to go in the vs code and in the resources views welcome here we have a header and we add in the slot header x mine header which is the component mind header and here we have links the home is going to be chef and we got a slash here is going to be the road all listings and the store is going to remove that and the contact i'm going to leave for now and here is going to be the route of the dashboard okay and hit save now come here refresh if i click here here we go to the dashboard and because i'm logging as the admin i can see all the admin links and if i log out and log in as the another user whether it is new user now i don't see the admin links but i'm going to remove that and the admin is going to be in the admin and something for example categories or listings or anything okay that's i'm going to fix in this video so first i'm going to go in the vs code and in the layouts app layout here we have the roll admin so if we are admin we display these roles otherwise we not displaying and here we have the classified admin and let's say dashboard okay and this i'm going to save as the admin layout okay and also in the app view my layout i'm going to save this as the admin layout so admin and change this to be admin as well and this one add live okay save close this and now in the admin layout we don't need to be roll up because it's going to be admin we are going to add the middleware in the road not here so we are going to go in the dark board yes and here classify admin ok save uh in the http controllers admin i'm going to create a new controller for the listings because we don't have a listing and i wanted here my listing i want to display all these things not only the user listing but admin listings okay here we have the my listing i'm going to change this and to be all listings okay save in the root it's going to be admin dot listings dot index and here as well okay and here i'm going to change this this one aside so it's going to be admin subcategories and admin here and i'm going to copy this and do the same thing for the child categories for the countries for the state for the city and i think we are okay so because here he now if someone go in the categories here he can create edit and delete categories because are not protected so in the road web php we can see the road resource for the categories has not any middleware restriction and i'm going to go to add them in the group so i'm going to cut from here and paste in the group where is going to be the middleware with a rolled admin and i'm going to pass the all the resources now if i go and refresh here the hero not found but because we had the prefix admin and if i go in the admin categories the user does not have the right roles but if we are admin and i'm going to give the admin role to that user who is in the dashboard so hit save and now go to the dashboard refresh now we are admin okay and if i go to the admin that means slash categories now we have the categories here okay but what i said if i go in the dashboard i want to remove that so in the app where i update php here we need to remove the that thing and now i need one more controller so if i go here and artisan make controller and i'm going to say admin and admin controller okay in the web php i'm going to say here road get and he's going to get the admin or just the slash and he's going to be the admin controller index not admin controller class sorry we are not in the level seven but in the level 8 so we need to add this here and the method is index and i'm going to give it a name admin dot index hit save and in the admin controller i'm going to make a method index and just return the view admin dot index it is not there but we are need to create that so in the admin i'm going to create a new file index dot blade dot php and here i'm going to do the same thing just copy and paste just change this to be admit hit save and now if i go to the admin okay we need to rename this admin layout okay refresh and now the road admin listings index not defined and i'm going to give it a name admit save save and refresh now oh yes sorry because i'm going to add just the index and if i save then refresh list and where we have the admin so okay so here we have the index so i wrote admin listings index why where is that so in the admin controller okay index of the i mean listings uh mine admin layout here yeah this road is not uh yet here so we need to create one more one more controller make controller and it's going to be listing controller resource okay and in the admin listing controller index just return a string hello for now and in the web we can say here road resource and listings listing controller we need to import controller from the admin and hit save okay come here and refresh why the road admin listings index is not defined now so if i give it a name admin and we need okay and the refresh hello friends so we are in the partuna to create an admin panel here we are in the dashboard and we are logging as the admin user so if i go now to the here we don't show any links for the categories and so on because we remove from the app blade so we have only the dashboard my listings and the new listing okay now if i go in the admin uh first thing i'm going to do is add the admin if the user is admin at the link here to go to the admin okay i forget that i'll go in the layouts up and i'm going to copy this one and check if the role is admin we're going to display that and roll and i'm going to say road where i would get name index admin index okay good index save from here refresh and yeah we need to change this would be admin refresh and now if i click here we go to the admin here we have the admin pen and here we go to the dashboard okay now we have categories subcategories and in the sub categories we need to make some changes so we need to go in the views sub categories here first i'm going to close all the open tags open files so subcategories create and i'm going to select all them and at the admin dot hit save go to edit the same thing admin dot okay and index up in dot expect we don't need here okay save come here and refresh now and now we have a sub categories here we can edit go back and delete okay yeah but you should you see here now i we are in the admin but we have the app layout if you see here yeah you need to change this to be admin okay the same thing for the edit and the same thing for the create okay save and now refresh now we are in the admin uh layout so go in the edit yeah go back new and yeah now for the child category the same thing first i'm going to close them and go to the child categories change the up to be and next we need to change the child device to be admin dot okay the same thing here okay and the same thing in the index change change this will be admin and child categories okay and refresh now yeah we are in the admin layer edit also here new yeah now for the countries we need to do the same thing and go to countries create change this to be admin also the role to be admin the same thing for the edit admin and the countries to be admin and for the index admin here and in the rows we need to do the same thing but uh just in the road not in the old so in the roads we need to change this to be admin dot com okay come here and refresh yeah we are in the admin panel here we have the admin layout and we can edit go back new country okay now for the state we need to do the same thing and go to the state here change the app to be admin layout also in the roads the same thing admin dot in the edit blade admin layout and in the state we need to be admin dot okay the index now admin layout and the road states admin dot okay close them and go back here refresh yeah we can edit states go back and create new states and we are in the admin layout the next one is the cities okay here in the cities create admin and also the road admin dot hit save go to the edit blade admin layout and interrupt admin okay and now in the index admin layout and in the road that mean okay here refresh now we are in the city and we can edit go back and new city okay now this is for this video we fix all the roads now we are in the in the next one i want to display all the listings here so well if i go in the index and x my layout admin no sorry in the my listings that mean where is the listings and go to the web php now we go back to the listings on dashboard so i go here again and my listings i want to say here all these things so in the admin layout change this to be all the listings and this is going to be the road for the admin.listings index and here admin.listing index and i think we don't have the http controllers admin yeah we have a listing controller here i'm going to create a method index and here i'm going to say the listings is going to be listing all and i'm going to return the view admin dot listings dot index with a compact listings and we need to import listing model it's safe we need now to i'm going to go in the listings and index select all copy and now in the admin i'm going to create new folder for the listings and here new file call it name it index dot blade dot php and here i'm going to paste what we copy from here just change this would be all listings and this would be admin the road here i'm going to remove this road for now or leave just now and here we can i'm going to leave it for now because here we need to make some changes the road is going to be admin these things edit and so on so just save here and in the web php okay we don't have the listings i'm going to do route resource listings and listing controller and we need to import that from the admin listing controller hit save and refresh again admin now we have all the listings here if i click we go into admin listings and we have the touch the up layout why we have applied here has been these things okay i think i changed these things index yeah i said admin layout and we need to display all the listings but in the listing controller the admin all these things and we go back okay we go in the admin listings so why where is the problem in the web we have the resource for the listings and yeah this listing controller is going to be the listing controller here because this one is going to be us we don't have import the listing con controller from the admin okay here hit enter and from the admin area we don't import don't have that okay copy and paste and now this is going to be listing controller ass admin listing controller and now we need to add it here admin listing controller hit save and go back to the admin now go to all listings and now we have all these things and we are in the admin panel okay friends hope you enjoyed this video and see you in the next one all the best hello friends so in the previous video we have fixed the roads for the admin panel we can navigate to the all listings and we have categories subcategories child categories countries states and cities in this video i want to fix when we navigate in the admin panel we have this text here but i want to show some cards for how many listings we have and how many categories subcategories and some users and for that i have advocate in the type block dot c c in the in this website i have find these cards i'm going to use them to display the so copy this clipboard and navigate in the vs code and we need to navigate in the admin index so where we have admin and the index blade and here we have i'm going to add them pass it here hit save and we need to run the npm run dev because we are using the jit of italian css okay and here if i refresh yeah now this numbers i want to add the real numbers we have so for that we need to go in the php and admin controller okay here i want to first i'm going to say the users it's going to be user all okay another thing i want listings and it's going to be listing all and the same thing for the categories sub categories okay sorry dollar sign and child categories is going to be with child category and all okay and if you want countries with country all and sorry dollar sign states with state all and the cities and now we need add them here so compact add users these things categories subcategories child categories and countries states and cities hit save now go in the index and then we have here i'm going to say here at least things and i'm with the display count of the listings and we have three listings and if i go in the table plus and navigate in the classified dots and listings and yeah we have only three and if i see for the users we have i think 14 yeah so come here and we have the users here and just display the count of the all users the same thing for the categories okay and here we can say categories and for the sub categories and we can display the the first category but not in this video or the first listing and the first user or the last one for now just i'm going to say that this is for the sub category and i'm going to copy this one and paste it again and this is going to be for the child categories and here child category hit save and come here refresh and here we have listings users for teams two categories two subcategories three chart category and so on we need for the country and this is going to be country okay now the states and this is going to be state and also the city and we need to add in the privilege plural so states countries child categories sub categories and so on it's safe come here and refresh and now we are okay so in the next video i want to add some so when we go we navigate in the categories you see here we display the name slug and image and also the edit and delete button and we have the subcategories here and we can can create new subcategory and here we have the categories that's okay here we have the child categories and we can create first we see here we have april lenovo and we have audi but if we have many of the child categories we don't maybe don't find them very quickly for the by the categories so i'm going to do is when you go in the categories i'm going to add a button here and click the create subcategories only for this specific category okay so we need to navigate in the categories for example the category with id one and add for example subcategories okay add sub categories and we are there we can create new subcategory just for the name because the category id is the sp the id we have here in the but this for this for the next video okay hope you enjoy and see you in the next one all the best and the same thing i want to do for the child categories for the states and cities okay friends bye hello friends welcome again so in the last video we fixed this admin panel now it's time to fix the sub categories here i want to add a link when we click there and go to create subcategories for this specific category okay so if i open the vs code i'm going to close all first and here we are in the categories index page but first i need to open the web php in the roads and after the categories i'm going to create a new load with the get and it's going to get categories slash category and i'm going to say add the sub categories what's up just like that and here i'm going to say category controller class and the method is going to be add sub and i'm going to name add sub again close this hit save and open the category index blade here and when we have a edit blade edit button i'm going to add one more thing one more for the so here copy and before that i'm going to add one more for add sub and we need admin our note is going to be at sub with a category id and here we can add the ads up i'm going to add flex here hit save and refresh now and here we have at sub we need the other margin two and padding maybe two or just muddy margin two here the same thing here and also here hit save come here and refresh so maybe just merging why not happen to yeah like this so we have what's up edit and delete and now when we go there whatsapp is not does not exist yeah so we need to go in the category controller and create that method method at sub and here we expect category dollar sign category and i'm going to return the view which is not here but i'm going to create that new file at sub.blade dot php and this is the the same thing as we have in subcategories create just select all copy and paste here new sub category four dollar sign category name and we go back to the admin categories index create subcategories it's going to be to the admin add sub store and it's going to have the same we don't need the category id because the category is there so we need to remove this one just the image and the name and save go here create return the view admin or where is the view view is inside the admin dot categories that add sub and i'm going to add the compact category here hit save and refresh yeah the road not defined because we need to copy and paste this one and this is going to be a post request so this adds sub and this is going to be add sub store and also add sub dot store and hit save from here refresh in the index not index in the add sub store here we need the category id here dollar sign category id and refresh yeah now we navigate in the categories one adds up and we have only the name and uh to choose a file and after that we now we need create a new method for the add sub store and we expect the category and dollar sign category and here i'm going to copy what we have in the sub category controller store the same thing just copy here and paste here the request we need to add the request so request dollar sign request okay subcategory import that or we can say sup categories create and category id is this category we have here and the id and we need to redirect in the category index okay i think we are if we have an image we need to go in the category category category because we don't have the method so subcategories and here we return the view sorry return dollar sign this has many sub category class save and in the category controller we say to the sign sub categories create i think we are okay refresh name is test one choose a file and hit save and the road categories index not defined yet we need to encoding the admin refresh okay continue and we go back now if i go in the sub categories and we have to test one test one because we made two and also here in the delete of the sub categories we have forget also here we need to add the admin and here admin and also here admin save and refresh continue and refresh delete again and i'm going to create one more time add sub here so we need we add subtotal electronics and tronics sub category hit save and let's never get to choose the image save and now go to the sub categories and yeah we have create and one more thing we need to do is when we go and edit this so category controller also here we need that admin admin admin again and also here also here and save and come here and refresh in the edit plate so categories added we need to add the admin here and refresh categories update again admin save and refresh and now yeah so here we are in the electronics after that this is the category here after this i'm going to display all the uh subcategories this electronics has okay so after the form yeah here we have a form and i'm going to add a div here and if i go in the subcategories index i'm going to copy what we have here and maybe paste it here but the category subcategories as a category and i'm going to refresh cut the gory like this and yeah now we have pc and electronics but first i'm going to do is here i'm going to say dif with a class of margin top four and maybe dear with class margin two and button two sub categories hit save and refresh yeah here we have subcategories now and we display all the subcategories this category has hope you enjoy and see you in the next one friends all the best hello friends in this video i'm going to do the same thing we did a in the last video for the categories okay we add this link and we go to the add sub here so we can create a new sub category for this specific category in this case is category with id 1. if i go back select the id 2 and we have the id 2 here and i'm going to do the same thing for the countries now and after that i'm going to create the same thing for the subcategories child categories states for the subcategory and states but i'm not going to shoot video for that just make that and uh update the github repository so you can find in the github okay so first i'm going to do is navigate in the web php and i'm going to copy the routes we have here and i'm going to paste it here just change this to be countries and country here okay add not sub but at state okay and now we need to create add state method in the category controller so navigate here and oh sorry it's not category controller but country controller and if i navigate here i'm going to make new method for the other state and we expect the category here dollar sign category and well my mistake country dollar sign country and i'm going to return the view admin countries and add state and also the country itself save and we need to create this add state finally in the countries new file add state dot blade dot php if i go in the states and create i'm going to copy that so select all copy and paste it here and we need to make changes new state for country name and i'm going to go back in there countries create state is going to do road in the admin countries dot at state dot store and this is hot state dot store so i think we need the or just make admin at state like this and we need to add the name and the country but the country is there so just the name and hit save okay now here in the controller we need to make new method for that state store and come here create that method okay method and with that name we expect the country here country dollar sign country and here i'm going to do the same thing we have in a state controller store just state create the request validated and we return back but i'm going to open the table plus so classified dots open and states has only the country id and the name so i'm going to say assign country states create and it's going to create a state with a name the request because we need to add the request here like this request name and we need to return redirect back to the country index with message state created and i'm going to save this and go and try so but first we need that link here so if i go first in the categories add sub blade or index blade categories index and here we have the links this for edit and this is for okay so in the hot state but in the country's index we have td i'm going to add the flex class here and just copy this one and paste it here and change the row to be admin countries at state and say here at state okay i'm going to save and refresh here comment result state not defined and we need to save this and refresh admin countries at state or not admin countries at state but just add state like this and refresh okay and also we need to that some classes here so px2 i think if i save in refresh the same thing here and the same thing here okay a refresh i think it's okay go to the hot state and yeah we need in the add state we need to add the country here country id and refresh country country like this okay now country for the state united states of america and i'm going to say boston hit save and the road countries index is not defined because here we have counter syntax we need to change this to be admin dot counters index and now refresh continue we have the message state created and if you go in the states we have joe for boston i'm going to delete and the state index is not defined because we need to add the admin before but i'm going to do in the next video just to show you here now so we don't have the boston go to the countries and create that boston okay hit save and we redirected back with state created and one more thing we need is if i go edit i'm going to display the same thing we displayed in the categories so he have displayed here i'm going to display the states there so if i go categories edit and we have not in that state so categories add it okay categories added and we display this uh table so we have this subcategories which is here and i'm going to copy this one and after the div i'm going to add the same thing in the countries edit so after the form here hot but we the states so i'm going to go in the index of states and here we have so i'm going to copy this one and close this and change with this here name country and this is for each country states as the state and do the same thing if i sit save and come here categor countries edit make states notable and defined variable states where we have the states links so i'm going to remove this and refresh and now we have the states here but why we forget at the okay yeah this before the table we need that this div and i'm going to say here states okay hit save and come here and refresh and yeah we have states here and we can go and edit the state okay friends that's it for this video hope you enjoy and see you in the next one all the best hello friends this video is going to be the last one for the for this series so we have created this home page we have the home link all ads and this is the username here and we go to the dashboard and here we have the post new ad we can add the link here i'm i have not had yet so i'm going to do this in the second in the admin area we have created for creating new listing to display all the listings okay we have the link to go in the dashboard and here we have my listings so the listing this user has this admin has or if you go to the admin and we have categories subcategories child categories countries states and cities of course and we have this filter by title cars countries and max price so if i filter by categories countries and so on my title in the home page i'm going to do is add the some feature ads and also the categories here okay go here and open the web php and inside the roads and here we have the road cat for the welcome just we return just the weapon blade and here we have the welcome blade in the mine header so components mine header here we have the for the username if we are authenticated and create new art is going to be inside the listings dot index data create so new ad is going to be now a button button link i'm going to change this to be anchor tag and sorry like this okay and the link is going to be road [Music] listing dot create hit save and come here i refresh okay now if i click here we go to the listings create good next thing is to add some popular categories here and for that if we want we can make here the categories but i'm going to do something else i'm going to add the front-end listing controller here so copy and paste here i'm going to name it name welcome okay and the method is going to be welcome as well so welcome hit save and now in the this controller i'm going to make a new method welcome and here i'm going to say categories is going to be category hold and import that and also what we need we need the feature ads here so is going to be listings this thing and where i'm going to open the table plus to see what we have for if we have a feature employee ads and inside the listings searcher is published we don't have yeah yeah we have only feature image but we don't have a feature column so if you want you can add more and more column and it's going to be feature or not okay i'm going to just order by or where is this published is true get and return return a view with compact and add categories there categories and also add feature ads okay it's safe and now in the while complete in main section mine section here property popular categories we have i'm going to i remove that and make and for each here so for each categories as category and cut this and paste it here here we can display the category name if i say vanco to the browser refresh and define categories because we don't yeah we save this so why we don't have undefined variable categories in the mind section i'm going to copy this one or just this for each now the slot here save in the web in the webcam here we have my section i'm going to save and refresh okay now we have two categories and the feature adds is going to be the same thing so in the future mine feature okay yeah shotting stars the catalyzer so remove two of them and cut this and say slot save close and here we can say for each featured ads as add here we can pass them and here we can say the title here i'm going to say description and hit save refresh and yeah we have one two three and this button is going to be sewing to mine head now mine header this is going to be the feature mine feature we have a button here i'm going to change this to b anchor tag and it's going to be the road listings index okay let's save come here and refresh and flex um and why is this so we have flex plus flex and here i'm going to pass this one okay no button but change not to be all listings and it's safe refresh now all these things go there to all these things oh yeah no sorry we don't go to all these things so all these things is like that listings what is the web roads yeah name is all this thing so change this to be all these things like this and go back now refresh we have a filter popular categories feature ads and all these things we call there okay friends here is the admin this is the basic one maybe in the future i'm going to create more advanced but i'm not i'm not sure hope you enjoy i'm going to create a video for the the full series so all the video in one long video and see you in the next series all the best
Info
Channel: Laraveller
Views: 1,108
Rating: undefined out of 5
Keywords: laravel, vuejs, livewire, laravel 8, laravel 9, laravel crud, laravel 8 tutorial, laravel 9 tutorial, How to Create A Classified Website wuth Laravel 8 and Livewire for Beginners, laravel for beginners, laravel for beginners 2021, laravel and livewire, laravel website with admin panel, laravel website project, olx clone
Id: 825PG334HhE
Channel Id: undefined
Length: 610min 34sec (36634 seconds)
Published: Mon Oct 11 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.