Laravel 5.1 Redirect with variable
<p>I am trying to redirect in Laravel like this:</p>

<p>in my controller:</p>

<pre><code>  $state = false;
  return redirect()-&gt;route('newPr')-&gt;with('errorMessageDuration', 'error', $state);
</code></pre>

<p>and in my view I try to get it like this:</p>

<pre><code>&lt;input id="PrId" type="text" value="{{ isset($state) ? $state : '' }}"&gt;
</code></pre>

<p>but somehow it does not work, it keeps being empty.</p>

<p>I want it to be saved permanently.</p>