Handle model route names

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe 2022-08-01 16:03:45 -07:00
parent b035003546
commit 744d0d299e
2 changed files with 6 additions and 6 deletions

View file

@ -16,10 +16,10 @@
<ul class="dropdown-menu">
@if ($model->deleted_at=='')
<li><a href="{{ route('models.edit', $model->id) }}">{{ trans('admin/models/table.edit') }}</a></li>
<li><a href="{{ route('clone/model', $model->id) }}">{{ trans('admin/models/table.clone') }}</a></li>
<li><a href="{{ route('models.clone.create', $model->id) }}">{{ trans('admin/models/table.clone') }}</a></li>
<li><a href="{{ route('hardware.create', ['model_id' => $model->id]) }}">{{ trans('admin/hardware/form.create') }}</a></li>
@else
<li><a href="{{ route('restore/model', $model->id) }}">{{ trans('admin/models/general.restore') }}</a></li>
<li><a href="{{ route('models.restore.store', $model->id) }}">{{ trans('admin/models/general.restore') }}</a></li>
@endif
</ul>
</div>
@ -316,7 +316,7 @@
@can('create', \App\Models\AssetModel::class)
<div class="col-md-12" style="padding-bottom: 5px;">
<a href="{{ route('clone/model', $model->id) }}" style="width: 100%;" class="btn btn-sm btn-warning hidden-print">{{ trans('admin/models/table.clone') }}</a>
<a href="{{ route('models.clone.create', $model->id) }}" style="width: 100%;" class="btn btn-sm btn-warning hidden-print">{{ trans('admin/models/table.clone') }}</a>
</div>
@endcan

View file

@ -28,7 +28,7 @@ Route::group(['prefix' => 'models', 'middleware' => ['auth']], function () {
AssetModelsController::class,
'getClone'
]
)->name('clone/model');
)->name('models.clone.create');
Route::post(
'{modelId}/clone',
@ -36,7 +36,7 @@ Route::group(['prefix' => 'models', 'middleware' => ['auth']], function () {
AssetModelsController::class,
'postCreate'
]
)->name('clone/model');
)->name('models.clone.store');
Route::get(
'{modelId}/view',
@ -52,7 +52,7 @@ Route::group(['prefix' => 'models', 'middleware' => ['auth']], function () {
AssetModelsController::class,
'getRestore'
]
)->name('restore/model');
)->name('models.restore.store');
Route::get(
'{modelId}/custom_fields',