From b1e68be54528dc74320bfb1e454d3985aaa2428e Mon Sep 17 00:00:00 2001 From: akemidx Date: Wed, 12 Apr 2023 18:33:44 -0400 Subject: [PATCH] delete button progress --- resources/lang/en/admin/hardware/general.php | 1 + resources/views/hardware/view.blade.php | 65 +------------------- routes/web/hardware.php | 6 +- 3 files changed, 6 insertions(+), 66 deletions(-) diff --git a/resources/lang/en/admin/hardware/general.php b/resources/lang/en/admin/hardware/general.php index b0a48f2ce4..bf1ec4283c 100644 --- a/resources/lang/en/admin/hardware/general.php +++ b/resources/lang/en/admin/hardware/general.php @@ -12,6 +12,7 @@ return [ 'clone' => 'Clone Asset', 'deployable' => 'Deployable', 'deleted' => 'This asset has been deleted.', + 'delete_confirm' => 'Are you sure you want to delete this asset?', 'edit' => 'Edit Asset', 'model_deleted' => 'This Assets model has been deleted. You must restore the model before you can restore the Asset.', 'model_invalid' => 'The Model of this Asset is invalid.', diff --git a/resources/views/hardware/view.blade.php b/resources/views/hardware/view.blade.php index 86783fc4c4..a7d05998f7 100755 --- a/resources/views/hardware/view.blade.php +++ b/resources/views/hardware/view.blade.php @@ -6,67 +6,6 @@ @parent @stop -{{-- Right header --}} -@section('header_right') - - - @can('manage', \App\Models\Asset::class) - @if ($asset->deleted_at=='') - - @endif - @endcan -@stop - {{-- Page content --}} @section('content') @@ -923,10 +862,10 @@ @can('delete', $asset) @if ($asset->deleted_at=='')
-
+ {{csrf_field()}} {{ method_field("DELETE")}} - +
@endif diff --git a/routes/web/hardware.php b/routes/web/hardware.php index 690d8e0d1c..765cf9afc7 100644 --- a/routes/web/hardware.php +++ b/routes/web/hardware.php @@ -146,9 +146,9 @@ Route::group( [AssetFilesController::class, 'show'] )->name('show/assetfile'); - Route::delete('{assetId}/showfile/{fileId}/delete', - [AssetFilesController::class, 'destroy'] - )->name('delete/assetfile'); + Route::delete('{assetId}/delete', + [AssetsController::class, 'destroy'] + )->name('hardware/delete'); Route::post( 'bulkedit',