alijumaan/laravel-ecommerce

Suggestion within the foreach

trondhuso opened this issue · 1 comments

foreach (Cart::content() as $item) {

It might be a good idea to create a variable with the content of Cart::content()

Back in my early days with PHP, I learned that doing it the way it is on the current like, PHP would go and look up all the time.
By storing the content in a variable you bypass this behaviour - if this is still the case for PHP in 2022.

Just something to consider.

Please close this issue. @alijumaan