Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

priyalaks's avatar

Login Controller - Add few checks

In my Ecommerce project , I am trying to check if the current user has any items in his cart with the help of session id. So When he adds items to cart and then tries to login - the session needs to be updated on the cart to preserve his cart items.

In order to achieve this I need to add few checks during login as the Session gets regenerated - so where should I add my Cart Logic checks .

I am using Laravel's default Auth Controller . I tried to add a function to the Login Controller - but that doesnt do the job.

0 likes
1 reply
priyalaks's avatar
priyalaks
OP
Best Answer
Level 1

Fixed . Added a custom Auth Controller and added my logic there ..

Please or to participate in this conversation.