Fixed back button

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe 2024-07-26 10:40:48 +01:00
parent 64082ada1e
commit 243ab51def
5 changed files with 6 additions and 5 deletions

View file

@ -1,6 +1,6 @@
<!-- begin redirect submit options -->
@props([
'route' => 'hardware.index',
'index_route',
'button_label',
'disabled_select' => false,
'options' => [],
@ -10,7 +10,7 @@
<div class="row">
<div class="col-md-3">
<a class="btn btn-link" href="{{ route($route) }}">{{ trans('button.cancel') }}</a>
<a class="btn btn-link" href="{{ $index_route ? route($index_route) : url()->previous() }}">{{ trans('button.cancel') }}</a>
</div>
<div class="col-md-9 text-right">

View file

@ -128,7 +128,7 @@
</div> <!--/.box-body-->
<x-redirect_submit_options
route="hardware.index"
index_route="hardware.index"
:button_label="trans('general.checkout')"
:disabled_select="!$asset->model"
:options="[

View file

@ -176,7 +176,7 @@
</div> <!--/.box-body-->
<x-redirect_submit_options
route="hardware.index"
index_route="hardware.index"
:button_label="trans('general.checkout')"
:disabled_select="!$asset->model"
:options="[

View file

@ -3,6 +3,7 @@
'createText' => trans('admin/hardware/form.create'),
'updateText' => trans('admin/hardware/form.update'),
'topSubmit' => true,
'index_route' => 'hardware.index',
'helpText' => trans('help.assets'),
'helpPosition' => 'right',
'formAction' => ($item->id) ? route('hardware.update', ['hardware' => $item->id]) : route('hardware.store'),

View file

@ -67,7 +67,7 @@
{{ csrf_field() }}
@yield('inputFields')
<x-redirect_submit_options
route="hardware.index"
:index_route="$index_route ?? null"
:button_label="trans('general.save')"
:options="$options ?? []"
/>