I\'m using default auth() in laravel login (email & password) Now i try to take input from the user in text field like (Age or City)
Now i want to store (Age/City) i
To work with session in your controller you need to include session first in your controller
use Session;
After that for store data in session. There is several ways to do it. I prefer this one (in controller)
session()->put('key',$value);
To display session data in your View you can do it like this
@if(Session::has('key'))
I'v got session data
@else
I don't have session data
@endif
To get session data in your Controller you can do it like this
session()->get('key')
//or
session()->get('key','defaul_value_if_session_dont_exist')
When you are done with your data in session you can delete it like this (in controller)
session()->forget('key');
All this basic usage of session is well documented in official Laravel documentation here.
Hope it helps you