Remove Product from Cart in Laravel | Laravel E-Ccommerce Project Tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everyone this is yin and welcome to L project tutor for beginner so in this tutorial we're going to delete the data from the card table so this will be really quick tutorial so for it let's go back to our code so we'll go back to our code and we'll go to our my card. PB and after this image we're going to have a option over here and that option name will be uh let's say remove and let's go down and after the inish TD we are going to mention another TD and in this T we are going to have anchor tag and then this anchor tag we're going to set remove then in this anchor tag boep plus and the glass will be BTN BTN it will be danger and in the H we'll give to Second bracket but before that let's just save it then let will just refresh and there you can see we have a remove ble right now so let's go back and in this H shift we get to second bracket then we SEC UR to first braet to single bation and we're going to get the ID for a specific product in the card so for it what we need to do is we can see dollar card we say here uh let me just give the name let's say delete underscore guard then we give a uh comma here then we're going to mention this dollar guard over here this Arrow sign will get the ID so right now let's save this and and let's go to our web.php and create this route so let me go to our web.php let me just copy this route then paste it here so our route will be get and here our route name is or delete card so let just copy this and we're to set here delete uncore carard we also need to cast the ID that we are sending from here and after that we use the home P our function name Will delete underscore power let's save this and let's go to our home controller so we'll go to our home controller then here we're going to say public F delore card first of all we get the ID then do second bracket so the ID we are catching is coming from here so here we're going to declare varable let's say dollar data equal we're going to measure out table model name which is car we say here find to5 dollar ID and after it we are going to say dollar data and we say delete after deleting data we let the user stay on the same place so we set here return redirect to fet this Arrow sign back so this is all we need to do to delete our data from the c t so if we now refresh here then let's say we want to delete uh this one if we click on delete there see the data is deleted so right now let's can show success message that data deleted successfully so for it let's go back to the code and let just go a little to and here you can see this is a toaster notification and we already install toaster in our L project so we can just copy this and after this delete paste it here and we are going to set P remove form the T successfully let's save it let's refresh here let's say we to remove this one click on remove and there you can see product remove from the C successfully this is all for this tutorial make sure to subscribe and I hope to see you in the future tutorials
Info
Channel: Web Tech Knowledge
Views: 86
Rating: undefined out of 5
Keywords: how to delete data in laravel, delete data in laravel, laravel, confirm and delete data in laravel, laravel delete data, delete data using ajax in laravel, delete record using ajax in laravel, delete in laravel, delete data in laravel 8, soft delete in laravel, laravel crud, how to delete data in laravel tutorial, how to delete data in laravel using ajax, how to delete data from database in laravel, how to remove data from database in laravel, delete data laravel
Id: ZLGT6gGNex8
Channel Id: undefined
Length: 3min 42sec (222 seconds)
Published: Mon May 06 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.