I have two fragments of code, and as far as i know both of them are doing pretty much the same thing. 

Which approach is correct in Laravel 5.5?

1.

```
$request->session()->put('login-error', '');
return redirect()->route('welcome');

```

2.

```
return redirect()->route('welcome')->with('login-error', '');

```