Question: Currently this is storing only first\_name in session. I need to store some other fields which are in the same database row like user\_role and city. How can I do that ?

**DashboardContaroller.php**

```
public function getIndex( Request $request )
    {
        $this->data['firstNames'] = \DB::table('tb_users')->orderBy('first_name')->lists('first_name', 'first_name');
        Session::put('firstName', $request->get('first_name'));     
        return view('dashboard.index',$this->data);
    }

```

**index.blade.php**

```
<form action="" method="post">
{!! Form::select('first_name', $firstNames) !!}
<button type="submit" value="Submit">Go</button>
</form>

```

**View**

```
<p>{{Session::get('firstName','default value')}}</p>

```

Answer: 
You can store the data as array:

```
Session::put('user', ['first_name' => $request->get('first_name'), 'user_role' => Auth::user()->user_role, 'city' => Auth::user()->city]);

```

View:

```
<p>{{Session::get('user')['city']}}</p>

```
You can store the object of the user, for example 

```
public function getIndex( Request $request )
{
    $this->data['firstNames'] = \DB::table('tb_users')->orderBy('first_name')->lists('first_name', 'first_name');
    Session::put('userData', ['firstName' => $request->get('first_name'), 'id' => $request->get('id')]);     
    return view('dashboard.index',$this->data);
}

```