xxxxxxxxxx
//set session
Session::put('sessionName', 'message');
//get session
Session::get('sessionName');
//don't forget to use "use Illuminate\Support\Facades\Session;"
xxxxxxxxxx
// laravel session
@if(Session::has('error'))
<div class="alert alert-danger">
{{ Session::get('error')}}
</div>
@endif
xxxxxxxxxx
// Via a request instance...
$request->session()->put('key', 'value');
// Via the global "session" helper...
session(['key' => 'value']);
xxxxxxxxxx
// Via a request instance...
$request->session()->put('key', 'value');
// Via the global "session" helper...
session(['key' => 'value']);