Laravel - Session - Storing Data

To store data in the session, you will typically use the request instance's put method or the global session helper:

    
    // Via a request instance...
    $request->session()->put('key', 'value');
    
    // Via the global "session" helper...
    session(['key' => 'value']);