php - usage of array session in laravel 4.2 -


i'm kinda lost in using array session in laravel 4.2. in documentation, says session::push('user.teams', 'developers');.

i'm assuming user.team session name developers value. can this,

session::push('book.id','1234'); session::push('book.name','sample book'); session::push('book.rating','5'); 

and i'll $bookname= session::get('book.name');

am doing right? or should use individual sessions?

first thing put array want, push elements array using . symbol

$user = ['name'=>'ahmed']; session::put('user' , $user);    // put array session::push('user.age','15');  // push element //$user = session::get('user');  // retrieve array dd(session::get('user.age'));    // retrieve 1 element 

Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -