Redirect in Javascript with data (laravel 5.3)
<p>I have to redirect on edit page with its data if user clicks on save button 
here is my button:</p>

<pre><code>&lt;button type="submit" name="edit" class="btn green" value="edit"&gt;Save&lt;/button&gt;
</code></pre>

<p>When user click this button i get name of button here in update controller as </p>

<pre><code>return $request-&gt;input('edit');
</code></pre>

<p>this return goes in to js file </p>

<pre><code>success: function(result) {
    if (result == 'save_add') {
        window.location = "/student-management/list/create"
    } else if (result == 'edit') {
        window.location = "////////////////////////////"
    }else {
         window.location = "/student-management/list"
    }
}
</code></pre>

<p>route is</p>

<pre><code>route('student.edit')
</code></pre>

<p>Here i am redirecting user to its actual path in case of edit on 2nd else if i want to redirect on edit page with its data 
i am working same here with other page in controller but i want to do this in js </p>

<pre><code>if(Input::get('save_add')) {
    return redirect()-&gt;route('student.create');
} elseif(Input::get('edit')) {
    return redirect()-&gt;route('student.edit', ['id' =&gt; $id ]);
} else {
    return redirect()-&gt;route('student.index');
}
</code></pre>

<p>I want to send same as above id with that redirect for edit </p>