laravel Session()->get() code example Example 1: session flash session()->flash('key', 'value'); Example 2: session laravel session(['name' => 'data']);