Awesome ! Not too fast not too slow. You are good teacher man.
@academind8 жыл бұрын
Amazing feedback! Thanks so much!
@einarbragigumundsson21287 жыл бұрын
php artisan migrate:refresh --seed it rolls back the migration, then runs them again and finally seeds the database, cheers :)
@jota49144 жыл бұрын
why to do find product again if already i have the product id? her can pass the object produc completly
@TechLunar5 жыл бұрын
Great tutorial and everything is very well explained. I am wondering on 8:14, what were the shortcuts you used to copy the current line into the next 2 lines. I am pretty sure this is a function built on the IDE you are using, but I would like to confirm. Thanks!
@academind5 жыл бұрын
Thank you! Please have a look at this article regarding the shortcuts => academind.com/learn/web-dev/visual-studio-code-introduction/#selected-shortcuts-where-to-configure-them
@keithcarrillo82386 жыл бұрын
Hey Max, when you mention cart key at @16:10 'Session::('cart') , how is that stored? Would it be stored by laravel checking if the 'cart' model had been used to store a cart item? Not sure how session::has & ::get pulls data. Thanks for the vids.
@faisalfaiz644 жыл бұрын
can you please explain to me this $oldCart = Session::has('cart') ? Session::get('cart') : null; where we have to create session ? in your video you are not creating it anywhere, so where we have to create it?
@pratikdahal71565 жыл бұрын
Hello there! What will I have to do for storing the color and size of the product as well?
@jeremiahmuhoho7336 жыл бұрын
thank-you Mindsapace .... how can I add a variant like color in the cart and to make each product with different color a different item?
@sheerasai59486 жыл бұрын
Hi bro I am watching ur series creates upto add to cart it works fine..but add to cart section the code which u wrote In the cart model and product controller I could not able to understand can u pls help me on that?
@metodejhrdlicka4 жыл бұрын
Why create new variable $cart each time I want to add item to it? Wouldn't be better to update old session variable instead?
@SkyZed_Sz5 жыл бұрын
How can I do if I want to add more things than product. Like I add product on the cart and can add another service too. So in the route I need to add ServiceController@addToCart ? but 'uses' takes just 1 parameter ?
@exoticwoodpen5 жыл бұрын
I'm new to Laravel and i'm using version 5.8. I've been following the code line by line and trying to understand but still get this error. shopcart\app\Cart.php public function __construct($oldCart) { if ($oldCart) { $this->items = $oldCart->items; $this->$totalQty = $oldCart->totalQty; $this->totalPrice = $oldCart->totalPrice; } } "Undefined variable: totalQty"
@ajmalhossainbappi53708 жыл бұрын
Thanks for coming back. You are such a great teacher. Advanced thanks for rest of the videos.
@academind8 жыл бұрын
Many thanks, that's awesome to hear! :)
@mattsteffler44276 жыл бұрын
Please help I’m getting an error that says “Class ‘App\Http\controllers\Cart’ not found” I’ve gone over the tutorial a couple times and can’t see what I’ve done wrong
@atypical_blk_guy4 жыл бұрын
I'm getting this error when my page loads; Symfony\Component\Routing\Exception\RouteNotFoundException Route [product.addToCart] not defined. (View: C:\xampp\htdocs\proshop esources\views\products\productDetails.blade.php)
8 жыл бұрын
This tutorial is amazingly clear and well structured. You saved me a lot of time and most important, helped me to understand how Laravel works. If you come to Majorca I will invite you a kingsize beer.
@academind8 жыл бұрын
Awesome to hear this - and I'll definitely come back to that the next time I'm there!
@guardrover8 жыл бұрын
Since you are using PHPStorm, the use statements are automatically added when you pick from the dropdown as you type.
@academind8 жыл бұрын
I know, but since not everybody uses PHPStorm, I try to highlight those imports the best I can.
@brayanangarita78165 жыл бұрын
Hi there. How can I add a size in case the product is a shoe or a blouse?
@SazaYT4 жыл бұрын
So when i added my first item, lets name it "chicken"..and then i try to add 'beef' in the basket as well, what will happen is the qty of chicken will go to 2 instead off adding the beef. Something must be wrong in my Basket.php class. Any ideas?
@sdshsjg4 жыл бұрын
hello , i have a problem when i hosted it on a shared hosting, when i click add to cart, then i click the menu href to cart page, suddenly my session gone
4 жыл бұрын
Please, how to reduce the Qtd in produt table?
@archeronx18 жыл бұрын
Another great tutorial. Also, great mention on the $request->session part. I wasn't aware the 2 were interchangeable. Thank you!
@academind8 жыл бұрын
Yeah I think those tiny things help a lot since that were the things I also struggled with when learning Laravel. Actually, Laravel has a lot of those interchangeable things, I'm happy that it was helpful to you :)
@jatinparekh20945 жыл бұрын
hey ! when i logout and again login add the added products deleted! why? and how to save that added product in cart save in database ..? thank you
@yashonathreddy18108 жыл бұрын
i want to store my cart both in session and database, so that user can get his cart on from any device . can u help me?
@heshananupama34098 жыл бұрын
my cart always replaces with new item added. So theres only one item in the cart every time. why is that. I worked for hours and still couldnt figure it out. I used the same code of yours. but still its the same :( could you please help me? i am using laravel 5.3
@alifatahi79528 жыл бұрын
Hey Im Using Laravel 5.3 and i dont have problem can you send your Cart Code here
@alifatahi79528 жыл бұрын
Hi Your Cart Class is correct Can you Send ProductContoller Class
@spoccobeech7 жыл бұрын
I was wondering, where did you get the $item variable that you passed on the add function? (or I'm just confused) because it doesn't make any changes. thanks for the response
@unpr3dict2ble6 жыл бұрын
You can call the argument anything you want. He chose to call it $item in the add() method. Anything that gets passed into the method from that point on will be referred to as $item protected function add($item, $id) { ......}
@aoonraza29067 жыл бұрын
Sir i have a error in code its show error like this FatalThrowableError in ProductsController.php line 44: Call to undefined function App\Http\Controllers\add() please help i am stuck in this part
@CabConHD5 жыл бұрын
Does anyone know a good tutorial for the following: - How to count views with cronjobs and use them instead to count them if a user request any view count?
@ahmedhussin57047 жыл бұрын
i wonder how you check Session::has('cart') before you putting it ?
@shem23828 жыл бұрын
hey do you have info on a star rating system, basically where user rates items. would you implement it in later tutorial if not, can you point me to some sources so i can learn how to implement this feature.
@academind8 жыл бұрын
I probably won't implement that in this series. I would basically simply google for it, then threads like this might be helpful: stackoverflow.com/questions/23383650/creating-a-star-rating-percentage-in-laravel
@shem23828 жыл бұрын
I think you were alluding to the need of a cms for a shopping cart or maybe I didn't quite get it. I think it was in the first video of this series.
@academind8 жыл бұрын
Hm, there might've been a little misunderstanding, I always planned to build everything on my own.
@shem23828 жыл бұрын
+Mindspace yeah I think I got that wrong my apologies. lol.
@amjadiqbal53536 жыл бұрын
i am getting error on this line , $this->items[$id] = $storedItem; Cannot use object of type App\Cart as array
@animeuncaged35534 жыл бұрын
hi, can you please do this with Ajax please?
@judealvarez61717 жыл бұрын
Im gettng a "Cannot use object of type stdClass as array" error on "{{ $product['item']['name'] }}" i cant get it right please help
@tadeupagliarini53118 жыл бұрын
After doing this class, it doesn't show my index page anymore, neither can I use the header, the last one happens just if i'm not logged in and I must be on the Profile page. Trought URL I can go to the user's page, sign in and sign up though.
@academind8 жыл бұрын
Hi Tadeu, maybe some kind of wrong place @if statement in the blade view? Do you get an error instead?
@tadeupagliarini53118 жыл бұрын
The error is the following Maximum function nesting level of 100 reached, aborting! Ps: I can only see this error if I look at the source-code on the browser.
@tadeupagliarini53118 жыл бұрын
I've managed to fix it. I had to change the php.ini file, adding the following code into the it xdebug.max_nesting_level = 200. Everything is working now. Thanks anyway and keep with the classes, they're great.
@academind8 жыл бұрын
Great to hear that everything's working now! :)
@ceylontwowheels40164 жыл бұрын
Is it Work with Laravel 7
@ijvseptianardi36167 жыл бұрын
Help me ! i cannot add qty on session its still one item qty , i use laravel 5.4 #thx
@Expolrethelife1687 жыл бұрын
same problem
@mazt19817 жыл бұрын
Hi, I solved writting some changes. (I use laravel 5.4 too) I Don't know why but when I get cart from session, that give a complete Cart object, I' don't need to create a new cart object with old cart object, instead that I use it. Hope to help you!
@mazt19817 жыл бұрын
PD: I use productid for products, use id if you create with that name
@احمدثابت-ث8خ7 жыл бұрын
you can try $request->session()->save() this function will force laravel to store session
@gourishankarrpujar99407 жыл бұрын
Thanks Bro it saved my day.
@kallaldeveloper90728 жыл бұрын
When I sign up a user, this shows, but it added data to database ErrorException in SessionGuard.php line 439: Argument 1 passed to Illuminate\Auth\SessionGuard::login() must implement interface Illuminate\Contracts\Auth\Authenticatable, none given
@kallaldeveloper90728 жыл бұрын
I fixed the problem, there is error in my userController code
@fduch078 жыл бұрын
ErrorException in Cart.php line 21: Trying to get property of non-object
@vaibhavmohan7757 жыл бұрын
why are migrations necessary can't we just work without them will there be some problem if we create database by ourself and use it
@unpr3dict2ble6 жыл бұрын
yes, but why not let laravel handle the db manipulation? I too thought the same thing when I started out, as it seems one more thing to learn, but in the end, it's so much easier.
@haroonattock22728 жыл бұрын
Trying to get property of non object .....this error occured :( plz tell me how to fix it
@academind8 жыл бұрын
Hi Muhammad, I don't know your code and as I'm no magician, I also have no chance of knowing when it occurred. So please provide a more detailed error message as well as your relevant source code (i.e. the code triggering the error). :)
@haroonattock22728 жыл бұрын
+Mindspace I have fixed it thanx :)
@mohamedmounir96868 жыл бұрын
can you tell me how fixed it plz?
@mohamedmetwaly23618 жыл бұрын
i have same problem here how have you fixed it???
@konstantingub6 жыл бұрын
Bro, how did you fix it ? Can you remember ?
@mehmettepeli14036 жыл бұрын
hi, how can i remove or update one product ?
@biresths31268 жыл бұрын
Aren't you providing full source code of this series on github??? i have downloaded it from github but there is no full source code
@academind8 жыл бұрын
Many question marks not always make a question better ... make sure to pick the right branch on the Github repo, all the source code is available there.
@biresths31268 жыл бұрын
please merge different branch into master branch.so that we can downlaod full sourcecode from same branch
@academind8 жыл бұрын
No, I won't do that because then the old code of the other videos would be lost (of course accessible by diving into the commits, but that's way to complicated)
@shahrukh6317 жыл бұрын
I don't know why but Cart Session is always evaluating to null on each addToCart request. Funny thing is I run that code on tinker and it worked perfectly fine, the session was being created and then items were being added to it. laravel 5.4
@mtzrmzia6 жыл бұрын
the code in GitHub its incomplete ... why?
@AmritKafleYoutubeChannel6 жыл бұрын
hello i want to update and delete shopping cart item tutorial too ?
@johnb87398 жыл бұрын
How would you output the user's name in the navbar upon authentication? So that it outputs something like Welcome, {{name}}? Great tutorial btw!
@amjadc8 жыл бұрын
since we are not saving the user's name but could be implemented by adding name variable to createUsersTable, and user model. At the Signup you should add another input field asking for user name.
@ardaktileu44818 жыл бұрын
Please,can you help me!After reloading of page i got error message like(ErrorException in Cart.php line 17: Undefined property: App\Cart::$price)?What is it?
@academind8 жыл бұрын
Are you using this code "App\Cart::$price"? That would be wrong, check your code and compare it with the video. Looking at this error message, specifically have a look at your price property. Is it set up correctly?
@ardaktileu44818 жыл бұрын
+Mindspace ok,Ty!
@ivalajk68078 жыл бұрын
Have you managed to fix it? I am encountering the same problem...
@ivalajk68078 жыл бұрын
Fixed... Somehow I managed to type $this->price instead of $item->price
@ardaktileu44818 жыл бұрын
iva lajk big thanks!
@thomasg20587 жыл бұрын
i'm building an eshop with clothes and i want each product have multiple colors..how can i store the same procuct with different color in session??can someone help me?
@jeremiahmuhoho7336 жыл бұрын
did you get a way out on this. I need the same
@jeremiahmuhoho7336 жыл бұрын
Academind could you please help us here?
@sankalp-will93716 жыл бұрын
This add to cart method works only if user is logged in, what if user is just surfing without logging in and he clicks on add to cart? redirect him to login page, that's too bad
@sankalp-will93716 жыл бұрын
You need to use cookies for that
@marcoantonio76346 жыл бұрын
where can i find the database?
@ceylontwowheels40164 жыл бұрын
Is it work with laravel 7 please tell mw guys 😥😥😥😥😥😥😥😥😥😥😥😥
@mdhemelrana82828 жыл бұрын
Thanks for this valuable series. You are such a great teacher. Hope you will be able to complete this series soon becoz we'r waiting for you. Many thanks for rest of the videos. Good Luck.
@academind8 жыл бұрын
I'm happy to hear that you're enjoying the series! :)
@mdhemelrana82828 жыл бұрын
You deserve it becoz you have earned it.
@MrDeveloper8 жыл бұрын
Hello, this is very nice tutorial. Are you uploading tutorial everyday ?
@gidimotje8 жыл бұрын
Awesome tutorial! I completed it and it was very clear. Thanks! Just one question. Is it possible to do the same thing without saving the price in a database? See it as kinda like a dynamic price.
@academind8 жыл бұрын
Of course, you could fetch/ calculate the price however you want.
@gidimotje8 жыл бұрын
Okay! Do I have to do that in my Cart model? Because I wouldn't know how to get the value of a input field hidden and set the price equal to that. Greetings from the Netherlands!
@academind8 жыл бұрын
Can't really explain this here as it's a bit too far beyond the scope of the video. If you get the value from an input field, why don't you just submit a form as you submit all forms in a PHP/ Laravel app?
@minhtaitrinh81098 жыл бұрын
Hey ,in line 27 that is allowed to assign or create a session?
@academind8 жыл бұрын
What do you mean with "allowed to assign or create a session"? I'm using the Session which gets created and managed by Laravel and of course it's allowed to add items to that session if you mean that.
@minhtaitrinh81098 жыл бұрын
$this->items=$a->items; I do not understand this place.
@academind8 жыл бұрын
Could you tell me where (minute mark) this code gets used?
@minhtaitrinh81098 жыл бұрын
line 14
@academind8 жыл бұрын
Hm, not able to find the code you're having problems with. At which minute in the video does it appear?
@bainapallisankar11936 жыл бұрын
when i will be trying addcart getting this error "Type error: Too few arguments to function App\Http\Controllers\ProductsController::getAdd(), 1 passed and exactly 2 expected" THis is my code please help me public function getAdd(Request $request,$id){ $products = Product::find($id); $oldCart = Session::has('cart') ? Session::get('cart'):null; $cart = new Cart($oldCart); $cart->add($products,$products->id); $request->session()->put('cart',$cart); dd($request->session()->get('cart')); return redirect('/'); }
@davidogheneovoedijala45976 жыл бұрын
Great Tutorial. Please can anyone share any resource on how to add colors and dynamic quantity to the cart? Thanks in Advance
@prabinbajracharya34888 жыл бұрын
Invalid argument supplied for foreach() (View: C:\Users\prabin\blog esources\views\shop\shopping-cart.blade.php)....i get this error
@academind8 жыл бұрын
Check your foreach loop there and also compare it to my code (link in video description). Maybe some typo.
@juandaniel28388 жыл бұрын
Im having the same problem :/, did you find where is the error?
@kennychansin8 жыл бұрын
Hello, nice video, how many tutorial you still have for that?
@academind8 жыл бұрын
I can't tell, I don't produce them in one big recording session. I'll see what I'll add :)
@kennychansin8 жыл бұрын
Oh!! i think you do a oneshot before upload it. still keep up because it's so coool I learn so much :)
@kennexmasaoy30266 жыл бұрын
How to remove 1 item in the cart?
@ShakirAli-wb5ho4 жыл бұрын
Really Lot's of thanks sir, Your explanation is very perfect
@akilraza115 жыл бұрын
Hello, Lovely tutorial , cleared my concept of adding to session really quick, but can you help me with how to delete a product from session ? please :)
@Codefide4 жыл бұрын
did you figure this out yet?
@mehmetcelik99118 жыл бұрын
Hello, when will you push the codes to github?
@academind8 жыл бұрын
Sorry if I forgot that, code should be available now (make sure to pick the right branch). Max
@mehmetcelik99118 жыл бұрын
Thank you, btw i like your tutorials :)
@academind8 жыл бұрын
That's really great to hear Mehmet! :)
@SigfriedSeldeslachts8 жыл бұрын
Why do you first type php arisan migrate:reset and then php artisan migrate you can just do php artisan migrate:refresh, It will do the same
@academind8 жыл бұрын
Absolutely correct. May I be honest? I mistakenly used the wrong one (wanted to use refresh) and then thought: "Well, let's go from there, then I show these two commands". When the time comes, I'll also show the other ;-)
@shem23828 жыл бұрын
php artisan migrate:refresh --seed
@SigfriedSeldeslachts8 жыл бұрын
Mindspace Haha was just wondering :)
@shem23828 жыл бұрын
Do you really have to build a cms to handle a shopping cart??
@academind8 жыл бұрын
What do you mean with CMS? I won't use a CMS in this series, but I won't build one either :-)
@josiahilesanmi81448 жыл бұрын
whats wrong building a CMS to handle a shopping cart?
@R6M38 жыл бұрын
One of the line in the ProductController should be like this: @16:30 $oldcart = Session::has('cart')?$request->session()->get('cart'):null; so that it will not replace the old item with new item, and will allow new items to be stored. As for the quantity, you can do it like this: public function add($item, $id, $qty) { $storedItem = ['qty'=>0, 'price'=>$item->price, 'item'=> $item]; if($this->items) { if(array_key_exists($id, $this->items)) { $storedItem = $this->items[$id]; } } $storedItem['qty'] += $qty; $storedItem['price'] = $item->price * $storedItem['qty']; $this->items[$id] = $storedItem; $this->totalQty += $qty; $this->totalPrice += $item->price; }
@minhtaitrinh81098 жыл бұрын
dd($value) it used to do?
@academind8 жыл бұрын
It's helpful to print out the value of a certain variable to the screen. Some quick debugging basically
@justinangeloperez87897 жыл бұрын
What editor are you using?
@academind7 жыл бұрын
I'm using PHPStorm by Jetbrains in this video
@justinangeloperez87897 жыл бұрын
thank you
@gazmirsulcaj51964 жыл бұрын
someone have this error : "Must provide source or customer" , when trying for checkout request?
@sheerasai59486 жыл бұрын
God Bless You, Your Efforts Creates Many web developers To The LimeLight.
@louisham69986 жыл бұрын
"syntax error, unexpected '$storedItem' (T_VARIABLE), expecting function (T_FUNCTION) or const (T_CONST)" $storedItem['qty']++; has a syntax error
@ilhamsabar36288 жыл бұрын
i get array is null. why ? please help me to solved this :D thanks before
@academind8 жыл бұрын
It's best if you compare your code to mine (code can be found in Github repo in video description). You most likely forget to set your shopping cart at some point or something like that
@Sarahnjeri3548 жыл бұрын
Hello. Did your code work. I had similar problem where my code was returning null but I solved it after a petty mistake.
@blackcaller96 жыл бұрын
for people still wondering about this one, check your cart model line4line there is prbly something different. in my case it was a $this that had 2 be $items
@mehtabhabib8 жыл бұрын
Awesome... been waiting for this one for a long time... because of node tutorials... Please update/complete laravel's eCommerce tutorial ASAP as you have been so easy to follow... :-)
@academind8 жыл бұрын
Happy to hear that you're liking it, but it'll still take some time as I got loads of other things to do as well ;-)
@ardaktileu44818 жыл бұрын
Thank you mate!
@retardiran878 жыл бұрын
Excellent video! And an excellent course overall!
@academind8 жыл бұрын
Many thanks! :)
@motgamer7684 жыл бұрын
i have this error in construct """"Unresolvable dependency resolving [Parameter #0 [ $oldPanier ]] in class App\Panier
@ilng20073 жыл бұрын
I'm having the same error, did you fix it?
@juancruzalric57718 жыл бұрын
when i try to access my product view i've got this error "syntax error, unexpected '$oldCart' (T_VARIABLE)" please someone can help me
@mehrdadgolestani31124 жыл бұрын
probably syntax error caused by typing "public __construct()" instead of "public function __construct()".not much help after 3 years:D
@kurtduane7 жыл бұрын
Session store not set on request how to fix it
@RichardOpokuEngineer6 жыл бұрын
use middlewareGroups 'web'
@minjon568 жыл бұрын
I'm wondering why we would add an item one by one? What if we want to buy i.e.10 items of one type and 20 items of another type? Imagine how many times we should have to click add-to-cart button? Well, I guess it's the easiest way to create a shopping cart, but it's not the way how things work in the real word where there is a quantity field for a customer to make their choice of quantity.
@UzomaUmekwe8 жыл бұрын
what you are talking about is quite easy to implement. I believe the tutor was intending to give us the basics on developing an e-commerce store so we can extend as we wish. Infact, i implemented this feature you talk about in less than 20mins including testing. I think we should appreciate him cos he has really done an excellent job with this tutorial.
@davidogheneovoedijala45976 жыл бұрын
Please can you share how you did this or a link to a resource that can. Thanks!
@PerryPalmtree6 жыл бұрын
Guys, where is 'cart' coming from? how does getAddToCart know what 'cart' is?
@Perasis6 жыл бұрын
use App\Cart;
@RazvanTSibiu6 жыл бұрын
you store all 'cart' information in a session called 'cart'
@shem23828 жыл бұрын
your angular 2 tutorial are very good as well. This one is awesome. Also JavaScript isn't my strong point should i just learn type script instead?? since the angular team seems to be pushing type script. honestly i prefer type script so far to JavaScript. What's your opinion on this matter??
@academind8 жыл бұрын
I prefer TypeScript, too, but there's no way around learning JavaScript. In the end TypeScript is based on it and you're still using built-in JS "commands"/ Objects. You might not have to be an expert but basic knowledge is certainly required and helpful
@shem23828 жыл бұрын
OK. Yeah I definitely agree
@nguyentrucxjnh8 жыл бұрын
@shemmarah john, me too. I scare JS and i learned TS instead, thank @Mindspace
@rizwanzafar16285 жыл бұрын
Helo sir it's next tutorial link....?
@jebbush29648 жыл бұрын
One questions, Can you make a tutorial on HOW TO DEPLOY A LARAVEL application to the cloud, Digital Ocean, AWS3, Heroku, etc. I have seen thousands of Laravel tutorials but there is not even a decent one on How to deploy. Can you teach us how to deploy using a MySQL database?
Will add that functionality in the future. You may of course try implementing this feature on your own as a little challenge though ;)
@mooodddy18 жыл бұрын
thanks for cooperative with me I waited complemented course I hope that is not delayed download more videos Thanks again :)
@digicat58517 жыл бұрын
Laraver offers better way then "php artisan migrate:reset" and then "php artisan migrate" just type "php artisan migrate:fresh"
@arfin50798 жыл бұрын
Hello #Mindspace Another nice tutorial when will you upload the next tutorial ??
@academind8 жыл бұрын
Thanks a lot. In a couple of days probably.
@MAHOSSAN15 жыл бұрын
Can you please upload the code into github
@partikelking3 жыл бұрын
your a master.. great thanks bro
@cccrockabilly5 жыл бұрын
thanks for the great tutorial, in laraval 5.8 use if (!session()->has('cart'))
@juanlucky81685 жыл бұрын
be more spesific please, how about the Session::get? or the oldCart before?
@cccrockabilly5 жыл бұрын
@@juanlucky8168 This was to check if your session allready had a cart, when following the tutorial with a new laravel version, you get an error
@gheorghiinita32788 жыл бұрын
Thank you very much for this tutorial - nice work!
@academind8 жыл бұрын
Thanks so much! :)
@shakinahazmansa7 жыл бұрын
hey guys. if you guys have the same problem as me on increment quantity on the shopping cart, you could try to change the $oldCart and the Session. somehow i dont know why or whats the reason of changing the codes make it work. try to view my codes and try to apply it okay. BTW im using Laravel 5.4. change in your ProductController.php the // is the codes from the tutorial i comment it so that you can know which one that i change. Good luck! public function getAddToCart(Request $request, $id){ $product = Product::find($id); $cart = Session::has('cart') ? Session::get('cart') : null; //$cart = new Cart($oldCart); if(!$cart) { $cart = new Cart($cart); } //$product = $product->id; $cart->add($product, $product->id); Session::put('cart', $cart); //$request->session()->put('cart', $cart); //var_dump($request->session()->get('cart')); return redirect()->route('products.index'); }
@newplayer13137 жыл бұрын
Shakinah Azman thanx!!
@abdullahsaid85617 жыл бұрын
still not work, mine 5.2
@keithcarrillo82386 жыл бұрын
is '$product = $product->id;' your code, instead?
@Ali-nj1tv5 жыл бұрын
I would appreciate if it is possible for you to add a comment on each line in "cart.php" page, due to this page is really a bit confused how this process works each step by it would help if you could put comment ane end of each line for us to understand each step of each line what is all about. please let me know, many thanks. AM
@Jesse-ty9ln3 жыл бұрын
thanks alot u rly helped me out
@sankalp-will93716 жыл бұрын
Use laravel's gloudemans cart package...
@niccubagonoc21536 жыл бұрын
Has anyone here extended this feature with AJAX? I've extended this project with user role management, product management, order status management features. All that is left is implementing AJAX when adding a product to cart.
@najmeddinhaidar96412 жыл бұрын
hey, great tutorial, I've been searching the internet to solve my cart variation issue without any luck so far, i was wondering if your could update the cart.php class or maybe share the code where a user can add product variations that affects the price (size, Color, ... etc).
@Slav0v7 жыл бұрын
God bless you man ! Really helpful all your videos. Really tnx ! Regards!!!
@academind7 жыл бұрын
Thanks so much Hristiqn, happy to hear you're liking my content!
@Slav0v7 жыл бұрын
Incredible helpful, really ! Greeting from Bulgaria! Good luck!
@oma37147 жыл бұрын
3:50 ф? xD
@jebbush29648 жыл бұрын
To all beginners PLEASE THE MOST IMPORTANT THING IS TO LEARN HOW TO DEPLOY A LARAVEL APP, if you are just learning but do not want to deploy it is ok to watch videos, do not make my same mistake, I have watched thousand of laravel tutorials but right b4 I was able to deploy I realized it is extremely difficult on the cloud, nobody is teaching how to deploy in the cloud, I do not why.
@academind8 жыл бұрын
But that's not true in my opinion. It's actually really simply. Of course I don't know what you mean with "the cloud", but simply googling for AWS (which I would call "the cloud") + Laravel, yields this article as a first result: docs.aws.amazon.com/elasticbeanstalk/latest/dg/php-laravel-tutorial.html
@jebbush29648 жыл бұрын
Thank you for your prompt reply, if it is so simple WHY nobody creates a complete deployment tutorial on this, All tutorials I watched suck big time, if you decide to create a complete tutorial on how to deploy a complete laravel app on AWS and migrate the database please let me know...
@academind8 жыл бұрын
I certainly will do some videos on the deployment in the future, but I can't tell when
@abhimanyuambastha25958 жыл бұрын
@Jeb Bush: I had a php app on my localhost and was able to deploy it on AWS just by watching their 'basic deploy a complete web app' instructions. It's almost same as working on localhost except you ssh in and you have to put some firewalls for your VM and DB server. And to migrate your db, you create a backup and restore it on your db server after copying your file on it (using SCP). Now, I don't know how different it would be with Laravel, but I'm assuming it wouldn't be that hard, especially if you know a bit on sys admin. If you cant find out a good tutorial, just give it a try and learn it the hard way :)
@jebbush29648 жыл бұрын
@Abhimanyu Ambastha: Thank you for your reply, Could you make a video tutorial on how to deploy a PHP app on AWS, I know thousands of people would be interested in watching a video about this subject..