I'm having a slight problem when trying to store and grab items from the session. I'm using an API and I am attempting to cache the results of this api into the session.
The problem is the API often returns domain names which I am trying to cache, google.com for example and then a value for that domain.
Unfortunately, when I store this using Session::put($domain, $value) and then return Session::all(), the array looks like the following...
array(
'google' =>
'com' => 'my_value'
)
I really need it to be...
array(
'google.com' => 'my_value'
)
As you can see, the dot notation is destroying the integrity of the array depending.
Looking at Laravel code, you won't be able to solve it easily. Laravel uses here Arr::set method which uses dot notation to create multi dimensional array.
You should consider replacing . into for example _ so instead google.com use google_com as your session key.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With