Via a request instance
$request->session()->put('key', 'value');
Via the global "session" helper
session(['key' => 'value']);
Push a new value onto a session value that is an array
// array of team names
$request->session()->push('user.teams', 'developers');
Comments