Тёмный

Laravel "Add to Cart": With/Without Livewire [LIVE-CODING] 

Laravel Daily
Подписаться 145 тыс.
Просмотров 50 тыс.
50% 1

Опубликовано:

 

4 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 58   
@stephaneleroux8993
@stephaneleroux8993 3 года назад
Would love it if you could continue this series. Great videos as usual.
@farhanhelmycode
@farhanhelmycode 3 года назад
Man, again! I'm currently developing dropship system! This is very helpful
@wimt505
@wimt505 3 года назад
loved the slow demo...could almost follow from the first time...
@bervetuna9267
@bervetuna9267 Год назад
This Cart package does not seem to be compatible with Laravel 10...
@lekhachungofficial
@lekhachungofficial 4 месяца назад
me too. Can you fix it?
@mrahamed5985
@mrahamed5985 3 года назад
Always your tutorial is simple clear & well understandable
@j.oliveira
@j.oliveira 3 года назад
You could create a getPriceAttribute() and setPriceAttribute() on the Product model so you don't have to worry about dividing or multiplying by 100. That would be delegated to those methods automatically.
@nandopookey9195
@nandopookey9195 Год назад
Thank you so much sir
@hosseinmirshafiei7843
@hosseinmirshafiei7843 2 года назад
amaziiiiiiiiiiiiiiiiiiiiiiiiiiiiiing
@shocchosolutions6275
@shocchosolutions6275 3 года назад
Sir you are great
@lucassouzasilva6842
@lucassouzasilva6842 3 года назад
This help me a lot
@RedempleMarcelo
@RedempleMarcelo 3 года назад
Thank you 😊
@thmgarnier
@thmgarnier Год назад
Hello there. I was following these steps and I got this after every second item added to the cart before the page refresh: Livewire \ Exceptions \ CorruptComponentPayloadException: Livewire encountered corrupt data when trying to hydrate the [products-table] component. Ensure that the [name, id, data] of the Livewire component wasn't tampered with between requests.
@AneesKhan-uz4mz
@AneesKhan-uz4mz 3 года назад
one problem with these cart packages is that when you associate the cart to a model and if the model is using something like spatie media-library relation, so when displaying the cart content as loop if you do $item->model->thumbnail->url (you will get n+1 queries)
@xankiiza
@xankiiza Год назад
I got error trying install that shopping item cart. Now I'm stuck.
@thomasnixon9585
@thomasnixon9585 2 года назад
was there a reason why you didn't use the Session facade that comes with laravel? Seems like that would have been easier than having to install a shopping cart package.
@lucianoelly529
@lucianoelly529 Год назад
thank you
@fritzsaycon5541
@fritzsaycon5541 5 месяцев назад
Hello, is there any way to put a timer on that alert success message and call it again then adding to cart? Thank you!
@mrcocl1707
@mrcocl1707 2 года назад
Dear sir, how to flash message according to your livewire sample. I did flash but table was gone. Sorry for my stupid question
@AhfazMalik
@AhfazMalik 3 года назад
it not add more than three products ?
@ABDOMOHAMED-AM
@ABDOMOHAMED-AM 2 года назад
hello . how can i get row Id for product in session to use it in remove from cart by Cart::remove method
@raveiga
@raveiga 2 года назад
Hi. Congratulations for your channel ! I recently subscribed and I love it ! What extension do you have installed in vscode to show the types of parameters in your functions? Thank you
@LaravelDaily
@LaravelDaily 2 года назад
I use phpstorm not vscode
@raveiga
@raveiga 2 года назад
@@LaravelDaily Ok, thank you.
@abelotugeme4362
@abelotugeme4362 2 года назад
Search for PhpStorm Parameter Hints in VScode. It's an extension
@turkialharbi9234
@turkialharbi9234 3 года назад
how can i use livewire for add to cart btn without moving the products blade file to blade livewire
@MrLinuxFreak
@MrLinuxFreak 2 года назад
20:24 I would just query the count and use array_fill with default value.. is it neccery to load all the products?
@ekap5394
@ekap5394 2 года назад
can i change livewire to vue.js for client validation on laravel?
@HaiNguyen-cf1ji
@HaiNguyen-cf1ji 3 года назад
I like your content but the thumbnail quite mislead, you still using JavaScript under the hood yet it the thumbnail say no JavaScript which not hold true
@HaiNguyen-cf1ji
@HaiNguyen-cf1ji 3 года назад
It should be add to card with livewire, clear and simple as the video title is
@PolopAnnie
@PolopAnnie 5 месяцев назад
not working in laravel 11!!
@renwar
@renwar 3 года назад
Make a video about refactoring and organizing controller method that contains advanced creating and calculations, for example: When checkout/save a cart I have a store method contains * create parent (sale) * check if parent created, then foreach items, check each item quantity for availability * then create child (sale_items) for each item in a loop * after creating each item, in a IF condition, update Item table to subtract the quantity of the item * wrap them in a transaction in case of failure in any of the items * write a success message
@LaravelDaily
@LaravelDaily 3 года назад
This old lesson sounds similar: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-ShrS3HXwzPg.html
@renwar
@renwar 3 года назад
​@@LaravelDaily Thank you, I watched this video before (It's been two years!!OMG) and I am watching it again it's so helpful and refreshing for me. A question: findOrFail() is questionable for me when working with API it does show 404 error but (No query results for model [App\\Models\\Purchase] 3), How do I change this error generally in the app? in order to be changed for every findOrFail() wherever to be used.
@LaravelDaily
@LaravelDaily 3 года назад
Try to override ModelNotFoundException in Exception Handler of Laravel. Sorry from mobile can't google the exact documentation part for you.
@renwar
@renwar 3 года назад
Appreciate the response, thats enough for me.
@ma08serrano
@ma08serrano 2 года назад
is there any continuation of this tutorial? i will purchase the course if there's a course.
@LaravelDaily
@LaravelDaily 2 года назад
Nope, sorry
@rustamandi5785
@rustamandi5785 2 года назад
What you use database?
@vincenttjong2290
@vincenttjong2290 2 года назад
wht version laravel? this video
@ashikeron9975
@ashikeron9975 3 года назад
Hello , Can you make laravel livewire and Custom Cart system tutorial , actualy i learn from custom cart without cart package . please make a video laravel livewire with custom cart
@poplach
@poplach 3 года назад
Are you planning to update 'money' field of quickadminpanel to be stored as integer?
@LaravelDaily
@LaravelDaily 3 года назад
We were thinking about it, but then it would mean to explain somewhere in the documentation how those operations are performed to convert to/from, and there's a big risk that developers wouldn't read that. So we went for less risky option for especially junior Laravel developers, which actually is a big part of our clients.
@poplach
@poplach 3 года назад
@@LaravelDaily If you do an additional field, lets say 'Money integer', it would be appreciated. I wouldn't change the old 'money' field, because it may cause many problems to your customers. But making another one instead would do the trick
@LaravelDaily
@LaravelDaily 3 года назад
Not sure if it's worth the effort, now we're focused on the Livewire version and its modules/features, don't want to change the plans there.
@alila3883
@alila3883 3 года назад
great
@GergelyCsermely
@GergelyCsermely 3 года назад
Thank You. I like it, that now excuse, all calculation have to move to controllers. :)
@shyloklord
@shyloklord 2 года назад
Hi there , How are you? would you please teach how to get the $rowId to remove an item? Thank you
@shyloklord
@shyloklord 2 года назад
Thanks and sorry , I have managed to work it out , rowId is already collected inside. i just have to pass it $cart->rowId like this ,,,,
@trifyy
@trifyy Год назад
@@shyloklord no it isnt
@GreatAdib
@GreatAdib 2 года назад
bro my php version 8.1 but this package is not installing it takes composer require bumbumen99/shoppingcart:* to work but i has Money package which is not working in latest php version pls check
@arturoatencio1433
@arturoatencio1433 2 года назад
Hey I got a problem, different scenario but similar code I tried to implement from this video, its about a form that works just fine when I insert a new record, but what im trying to do is to get a sibbling component which is the table for all records to display that new one inmediately. So, I have a parent component and two sibblings components, one is the new record form, and the other one the table that should display all records and any new one as soon as it has been inserted into the DB. So after I create that new record, it emits the event from then form-component, and into the list-component the listener is already set up (quite similar to the event that updates the cart quantity after the 'add to cart' process finish the *Cart::add*). I can even see the event triggering, but it just doesnt update the list/table-component, so I have to reload the page to see this new record. Can someone help?
@arturoatencio1433
@arturoatencio1433 2 года назад
@Laravel Daily I think I found half the problem, when the update comes up, and it triggers the event, wich points to the render method, for some reason, it goes into a where in query (noticed that using the laravel-debugbar) but it shouldnt. When you load the page normally or pressing f5 it will do a Order::orderBy(); wich translates into ''select * from 'orders' order by 'id' desc'', but when its reloaded by the event, it will do that random where in query that only includes the ids of the records already on the table, excluding the fresh new just inserted one. So, it wont never display that new records if it is not inside the wherein condition, but i dont have any idea why this is triggering that Pls help 😕
@salmasheikh3480
@salmasheikh3480 3 года назад
🥀🥀🥀
Далее
Laravel Checkout: Database Transactions and Validation
16:24
ВЫЖИЛ В ДРЕВНЕМ ЕГИПТЕ!
13:09
Просмотров 130 тыс.
Тренд Котик по очереди
00:10
Просмотров 279 тыс.
Laravel Security: Top 7 Mistakes Developers Make
11:16
9 Tips for Shorter Laravel Code
10:16
Просмотров 61 тыс.
Laravel + Livewire todo app (and so much more)
16:41
Просмотров 46 тыс.
4 Tips to Improve Leah's Laravel Code
8:43
Просмотров 4,7 тыс.
PHP on the frontend! No more Javascript!
14:47
Просмотров 123 тыс.
Laravel Pivot Tables: Simple to Advanced Many-to-Many
12:24
Eloquent Performance: TOP 3 Mistakes Developers Make
7:59
ВЫЖИЛ В ДРЕВНЕМ ЕГИПТЕ!
13:09
Просмотров 130 тыс.