2

I'm trying to set nested array in sessions using laravel methods.

So i need to get something like this

$_SESSION['order'][$productId] = array();

Is it possible to do with laravel built-in methods?

1

1 Answer 1

1

There is a little dirty way of achieving this:

$sessionData = Session->get('parentKey')

Than do some processing of data and add nested data to it, then do:

Session->put('parentKey', $sessionData)

I hope it is helpful for you.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.