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>