Redirect to the subfleet aircraft list on save #932
This commit is contained in:
parent
9cf07c47c7
commit
a7981c0a87
@ -160,6 +160,7 @@ class AircraftController extends Controller
|
||||
*/
|
||||
public function update($id, UpdateAircraftRequest $request)
|
||||
{
|
||||
/** @var \App\Models\Aircraft $aircraft */
|
||||
$aircraft = $this->aircraftRepo->findWithoutFail($id);
|
||||
|
||||
if (empty($aircraft)) {
|
||||
@ -171,7 +172,7 @@ class AircraftController extends Controller
|
||||
$this->aircraftRepo->update($attrs, $id);
|
||||
|
||||
Flash::success('Aircraft updated successfully.');
|
||||
return redirect(route('admin.aircraft.index'));
|
||||
return redirect(route('admin.aircraft.index').'?subfleet='.$aircraft->subfleet_id);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -183,6 +184,7 @@ class AircraftController extends Controller
|
||||
*/
|
||||
public function destroy($id)
|
||||
{
|
||||
/** @var \App\Models\Aircraft $aircraft */
|
||||
$aircraft = $this->aircraftRepo->findWithoutFail($id);
|
||||
|
||||
if (empty($aircraft)) {
|
||||
|
@ -96,7 +96,6 @@
|
||||
<div class="form-group col-sm-12">
|
||||
<div class="pull-right">
|
||||
{{ Form::button('Save', ['type' => 'submit', 'class' => 'btn btn-success']) }}
|
||||
<a href="{{ route('admin.aircraft.index') }}" class="btn btn-default">Cancel</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user