yassine j
yassine j

Reputation: 515

Laravel. How to call specific array in object when using Session?

Please take a look first to my picture to see data structure. I would like to call 'event_name'

i have tried :

$session->event_name;

This not working. enter image description here

Upvotes: 0

Views: 22

Answers (1)

Full Stack Alien
Full Stack Alien

Reputation: 12541

Your screenshot displays an array, therefore the value would be accessible like so:

$session['event_name'];

But if you are using the Laravel session tools: https://laravel.com/docs/5.8/session#retrieving-data

You can do this:

$session->get('event_name');

Upvotes: 1

Related Questions