laravel-ecommerce-example icon indicating copy to clipboard operation
laravel-ecommerce-example copied to clipboard

Trying to access array offset on value of type null

Open odion-cloud opened this issue 4 years ago • 4 comments

Trying to access array offset on value of type null !

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

odion-cloud avatar Sep 13 '20 13:09 odion-cloud

I have the same issue

grcornejoa avatar Sep 22 '20 15:09 grcornejoa

I have the same issue

have you been able to fix yours?

odion-cloud avatar Sep 24 '20 10:09 odion-cloud

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

Martin-1182 avatar Sep 24 '20 10:09 Martin-1182

Hi, yes

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

El jue., 24 set. 2020 5:39 a. m., Martin Halaj [email protected] 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 .

grcornejoa avatar Sep 24 '20 11:09 grcornejoa