use IlluminateSupportFacadesSession;
Session::put('key', 'value');
session(['key' => 'value']);
//set session
Session::put('sessionName', 'message');
//get session
Session::get('sessionName');
//don't forget to use "use IlluminateSupportFacadesSession;"
Session::put('variableName', $value);
session()->put('telegram_login', false);
$value = Session::get('key');
$value = session('key');
Session::get('variableName');
// Via a request instance...
$request->session()->put('key', 'value');
// Via the global "session" helper...
session(['key' => 'value']);
Session::put('key', 'value');
session(['key' => 'value']);
// Via a request instance...
$request->session()->put('key', 'value');
// Via the global "session" helper...
session(['key' => 'value']);
session(['variableName' => $value]);
php artisan session:table
@if(Session::has('success'))
<div class="alert alert-success">
{{ Session::get('success') }}
@php
Session::forget('success');
@endphp
</div>
@endif
'for make session: syntax: session(key => value), ex. session('user1'=>'kinjal')
session can remove using forget() perticular user; syntax: session().forget(key);
To delete all users from session: syntax: session()->flush();
To fetch all session data: syntax: session()->all();
$data=[
'name' => $request->input('name')
];
session(['data'=>$data]);
$data=Session::get('data');
$data1=[
'email'=>$request->input('email')
];
$data=array_merge( $data, $data1);
session(['data'=>$data]);
session()->regenerate();
unset($_SESSION);