drehimself / laravel-ecommerce-example

Code for YouTube series on building a Laravel E-Commerce application.
https://www.youtube.com/watch?v=o5PWIuDTgxg&list=PLEhEHUEU3x5oPTli631ZX9cxl6cU_sDaR
1.01k stars 585 forks source link

Trying to access array offset on value of type null #99

Open odion-cloud opened 3 years ago

odion-cloud commented 3 years ago

Trying to access array offset on value of type null !

this error comes out when i want to add knew cart item

grcornejoa commented 3 years ago

I have the same issue

odion-cloud commented 3 years ago

I have the same issue

have you been able to fix yours?

Martin-1182 commented 3 years ago

$couponName = session()->get('coupon')['name'] ?? null;

grcornejoa commented 3 years ago

Hi, yes

Try this $couponName = isset(session()->get('coupon')['name']);

El jue., 24 set. 2020 5:39 a. m., Martin Halaj notifications@github.com escribió:

$couponName = session()->get('coupon')['name'] ?? null;

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/drehimself/laravel-ecommerce-example/issues/99#issuecomment-698263905, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJONGIBMSX4TEN2N7PTWQCTSHMOUXANCNFSM4RKVCXVA .