I need two submit button for my update form,
current setting
Currently when I hit submit it saves my data and redirect me another page where i can edit my multiple images (so my form is like two step function)
What I want to add
I want to add another button in order to just save my data and return me to index page (skip second step)
last result
Last result will be my edit form with two button
- button 1 saves data and return me to next form to edit my images
- button 2 saves data and return me to index page
Codes
controller function
public function update(Request $request, $id)
{
// validation and....
$product->save();
// this is my current button action (redirect to second step)
return redirect()->route('editmultiimages',
$product->id)->with('success',
'Product, '. $product->title.' updated, now you can edit images.');
// need second button action here
}
blade form
{{ Form::model($product, array('route' => array('products.update', $product->id), 'method' => 'PUT', 'files' => true)) }}
// my inputs
// my current button (saves data and goes to next step)
{{ Form::submit('Edit Images', array('class' => 'btn btn-success')) }}
{{Form::close()}}
Any idea?