diff --git a/resources/views/account/change-password.blade.php b/resources/views/account/change-password.blade.php index 57509e5fab5a..d344e80b8051 100755 --- a/resources/views/account/change-password.blade.php +++ b/resources/views/account/change-password.blade.php @@ -11,7 +11,12 @@
- {{ Form::open(['method' => 'POST', 'files' => true, 'class' => 'form-horizontal', 'autocomplete' => 'off']) }} +
@@ -63,7 +68,7 @@
- {{ Form::close() }} +
@stop diff --git a/resources/views/account/profile.blade.php b/resources/views/account/profile.blade.php index d27367192a6b..91cc76e35ff7 100755 --- a/resources/views/account/profile.blade.php +++ b/resources/views/account/profile.blade.php @@ -10,7 +10,12 @@
- {{ Form::open(['method' => 'POST', 'files' => true, 'class' => 'form-horizontal', 'autocomplete' => 'off']) }} +
@@ -177,7 +182,7 @@
- {{ Form::close() }} +
diff --git a/resources/views/blade/form.blade.php b/resources/views/blade/form.blade.php new file mode 100644 index 000000000000..730a53839b17 --- /dev/null +++ b/resources/views/blade/form.blade.php @@ -0,0 +1,19 @@ +@props([ + 'route', + 'method' => 'POST', + 'files' => false, +]) + +
+ @csrf + @if(in_array(strtoupper($method), ['PUT', 'PATCH', 'DELETE'])) + + @endif + {{ $slot }} +
diff --git a/resources/views/custom_fields/fields/edit.blade.php b/resources/views/custom_fields/fields/edit.blade.php index 12c3a3fb735e..a5e6644a3022 100644 --- a/resources/views/custom_fields/fields/edit.blade.php +++ b/resources/views/custom_fields/fields/edit.blade.php @@ -22,14 +22,11 @@ @section('content') - @if ($field->id) - {{ Form::open(['route' => ['fields.update', $field->id], 'class'=>'form-horizontal']) }} - {{ method_field('PUT') }} - @else - {{ Form::open(['route' => 'fields.store', 'class'=>'form-horizontal']) }} - @endif - - @csrf +
@@ -263,7 +260,7 @@ class="fieldset"
-{{ Form::close() }} + @stop @section('moar_scripts') diff --git a/resources/views/custom_fields/fieldsets/view.blade.php b/resources/views/custom_fields/fieldsets/view.blade.php index b73ae708c669..9e93d8df43bc 100644 --- a/resources/views/custom_fields/fieldsets/view.blade.php +++ b/resources/views/custom_fields/fieldsets/view.blade.php @@ -88,10 +88,11 @@ - {{ Form::open(['route' => - ["fieldsets.associate",$custom_fieldset->id], - 'class'=>'form-inline', - 'id' => 'ordering']) }} +
@@ -118,7 +119,7 @@ - {{ Form::close() }} + diff --git a/resources/views/custom_fields/index.blade.php b/resources/views/custom_fields/index.blade.php index 5f892b272fcc..f19aae6e028e 100644 --- a/resources/views/custom_fields/index.blade.php +++ b/resources/views/custom_fields/index.blade.php @@ -87,13 +87,17 @@ class="table table-striped snipe-table" @endcan @can('delete', $fieldset) - {{ Form::open(['route' => array('fieldsets.destroy', $fieldset->id), 'method' => 'delete','style' => 'display:inline-block']) }} + @if($fieldset->models->count() > 0) @else @endif - {{ Form::close() }} + @endcan @@ -192,7 +196,11 @@ class="table table-striped snipe-table" - {{ Form::open(array('route' => array('fields.destroy', $field->id), 'method' => 'delete', 'style' => 'display:inline-block')) }} + @can('update', $field) @@ -214,7 +222,7 @@ class="table table-striped snipe-table" @endif @endcan - {{ Form::close() }} + diff --git a/resources/views/depreciations/view.blade.php b/resources/views/depreciations/view.blade.php index b49bf0b9e156..e3dc1c037fc9 100644 --- a/resources/views/depreciations/view.blade.php +++ b/resources/views/depreciations/view.blade.php @@ -129,13 +129,11 @@ class="table table-striped snipe-table"
- {{ Form::open( - [ - 'method' => 'POST', - 'route' => ['models.bulkedit.index'], - 'class' => 'form-inline', - 'id' => 'bulkForm'] - ) }} +
@@ -176,7 +174,7 @@ class="table table-striped snipe-table"
- {{ Form::close() }} +
diff --git a/resources/views/hardware/audit.blade.php b/resources/views/hardware/audit.blade.php index 2a88e171bc43..8604df7dbaea 100644 --- a/resources/views/hardware/audit.blade.php +++ b/resources/views/hardware/audit.blade.php @@ -21,11 +21,11 @@
- {{ Form::open([ - 'method' => 'POST', - 'route' => ['asset.audit.store', $asset->id], - 'files' => true, - 'class' => 'form-horizontal' ]) }} +

{{ trans('admin/hardware/form.tag') }} {{ $asset->asset_tag }}

@@ -140,7 +140,7 @@ {{ trans('general.audit') }}
- +
diff --git a/resources/views/hardware/quickscan-checkin.blade.php b/resources/views/hardware/quickscan-checkin.blade.php index de892399cc3a..e84878da47fb 100644 --- a/resources/views/hardware/quickscan-checkin.blade.php +++ b/resources/views/hardware/quickscan-checkin.blade.php @@ -19,7 +19,12 @@
- {{ Form::open(['method' => 'POST', 'class' => 'form-horizontal', 'role' => 'form', 'id' => 'checkin-form' ]) }} +
@@ -78,7 +83,7 @@ - {{Form::close()}} +
diff --git a/resources/views/hardware/quickscan.blade.php b/resources/views/hardware/quickscan.blade.php index 867eeaa2b098..9b1253133cba 100644 --- a/resources/views/hardware/quickscan.blade.php +++ b/resources/views/hardware/quickscan.blade.php @@ -19,7 +19,12 @@
- {{ Form::open(['method' => 'POST', 'class' => 'form-horizontal', 'role' => 'form', 'id' => 'audit-form' ]) }} +
@@ -92,7 +97,7 @@ - {{Form::close()}} +
diff --git a/resources/views/hardware/requested.blade.php b/resources/views/hardware/requested.blade.php index 969bf991a674..7506a7c55160 100644 --- a/resources/views/hardware/requested.blade.php +++ b/resources/views/hardware/requested.blade.php @@ -100,18 +100,11 @@ class="table table-striped snipe-table" {{ App\Helpers\Helper::getFormattedDateObject($request->created_at, 'datetime', false) }} - {{ Form::open([ - 'method' => 'POST', - 'route' => [ - 'account/request-item', - $request->itemType(), - $request->requestable->id, - true, - $request->requestingUser()->id - ], - ]) }} + - {{ Form::close() }} + @if ($request->itemType() == "asset") diff --git a/resources/views/hardware/view.blade.php b/resources/views/hardware/view.blade.php index a0c8c862ce1f..4c35753e38b5 100755 --- a/resources/views/hardware/view.blade.php +++ b/resources/views/hardware/view.blade.php @@ -249,18 +249,18 @@ @endcan
- {{ Form::open([ - 'method' => 'POST', - 'route' => ['hardware/bulkedit'], - 'class' => 'form-inline', - 'target'=>'_blank', - 'id' => 'bulkForm']) }} + - {{ Form::close() }} +
@can('delete', $asset) @@ -1227,11 +1227,11 @@ @if ($asset->assignedAssets->count() > 0) - {{ Form::open([ - 'method' => 'POST', - 'route' => ['hardware/bulkedit'], - 'class' => 'form-inline', - 'id' => 'bulkForm']) }} +
diff --git a/resources/views/models/index.blade.php b/resources/views/models/index.blade.php index cc2986cb876a..6f3f5e78df44 100755 --- a/resources/views/models/index.blade.php +++ b/resources/views/models/index.blade.php @@ -62,7 +62,6 @@ class="table table-striped snipe-table"
- {{ Form::close() }}
diff --git a/resources/views/models/view.blade.php b/resources/views/models/view.blade.php index f26b9babd4b1..3d53745513af 100755 --- a/resources/views/models/view.blade.php +++ b/resources/views/models/view.blade.php @@ -98,7 +98,6 @@ class="table table-striped snipe-table" "ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"] }'> - {{ Form::close() }}
diff --git a/resources/views/partials/asset-bulk-actions.blade.php b/resources/views/partials/asset-bulk-actions.blade.php index 992fb52bba10..ae1155131c42 100644 --- a/resources/views/partials/asset-bulk-actions.blade.php +++ b/resources/views/partials/asset-bulk-actions.blade.php @@ -1,10 +1,9 @@
-{{ Form::open([ - 'method' => 'POST', - 'route' => ['hardware/bulkedit'], - 'class' => 'form-inline', - 'id' => (isset($id_formname)) ? $id_formname : 'assetsBulkForm', - ]) }} + {{-- The sort and order will only be used if the cookie is actually empty (like on first-use) --}} @@ -34,5 +33,5 @@ - {{ Form::close() }} +
diff --git a/resources/views/partials/locations-bulk-actions.blade.php b/resources/views/partials/locations-bulk-actions.blade.php index 228a68dfbab6..8cc9bf9a4c74 100644 --- a/resources/views/partials/locations-bulk-actions.blade.php +++ b/resources/views/partials/locations-bulk-actions.blade.php @@ -1,10 +1,10 @@ @can('delete', \App\Models\Location::class)
- {{ Form::open([ - 'method' => 'POST', - 'route' => ['locations.bulkdelete.show'], - 'class' => 'form-inline', - 'id' => 'locationsBulkForm']) }} +
@@ -14,7 +14,7 @@
- {{ Form::close() }} +
@endcan diff --git a/resources/views/partials/models-bulk-actions.blade.php b/resources/views/partials/models-bulk-actions.blade.php index 8fca921ae1b7..340fa1fd6b92 100644 --- a/resources/views/partials/models-bulk-actions.blade.php +++ b/resources/views/partials/models-bulk-actions.blade.php @@ -1,9 +1,9 @@
- {{ Form::open([ - 'method' => 'POST', - 'route' => ['models.bulkedit.index'], - 'class' => 'form-inline', - 'id' => 'modelsBulkForm']) }} + @if (request('status')!='deleted') @can('delete', \App\Models\AssetModel::class) @@ -17,7 +17,7 @@
@endcan @endif - {{ Form::close() }} +
diff --git a/resources/views/partials/users-bulk-actions.blade.php b/resources/views/partials/users-bulk-actions.blade.php index 2d371157dbd6..821c212d995d 100644 --- a/resources/views/partials/users-bulk-actions.blade.php +++ b/resources/views/partials/users-bulk-actions.blade.php @@ -3,11 +3,11 @@ @if (request('status')!='deleted') - {{ Form::open([ - 'method' => 'POST', - 'route' => ['users/bulkedit'], - 'class' => 'form-inline', - 'id' => 'usersBulkForm']) }} +
@@ -28,7 +28,7 @@
- {{ Form::close() }} +
@endif diff --git a/resources/views/reports/activity.blade.php b/resources/views/reports/activity.blade.php index d2e0107649f5..f9737fbc7231 100644 --- a/resources/views/reports/activity.blade.php +++ b/resources/views/reports/activity.blade.php @@ -7,13 +7,13 @@ @stop @section('header_right') - {{ Form::open(['method' => 'post', 'class' => 'form-horizontal']) }} - {{csrf_field()}} + + - {{ Form::close() }} + @stop {{-- Page content --}} diff --git a/resources/views/reports/custom.blade.php b/resources/views/reports/custom.blade.php index 3ab43ed6b3b5..48a9254639da 100644 --- a/resources/views/reports/custom.blade.php +++ b/resources/views/reports/custom.blade.php @@ -35,13 +35,11 @@
- {{ Form::open([ - 'method' => 'post', - 'class' => 'form-horizontal', - 'id' => 'custom-report-form', - 'url' => request()->routeIs('report-templates.edit') ? route('report-templates.update', $template) : '/reports/custom', - ]) }} - {{csrf_field()}} +
@@ -610,7 +608,7 @@ class="btn btn-sm btn-danger delete-asset" @endif
- {{ Form::close() }} +
diff --git a/resources/views/reports/unaccepted_assets.blade.php b/resources/views/reports/unaccepted_assets.blade.php index b26539700b6a..b7fb7f6b36aa 100644 --- a/resources/views/reports/unaccepted_assets.blade.php +++ b/resources/views/reports/unaccepted_assets.blade.php @@ -19,10 +19,9 @@ @endif
- {{ Form::open(['method' => 'post', 'class' => 'form-horizontal']) }} - {{csrf_field()}} + - {{ Form::close() }} +
@stop diff --git a/resources/views/settings/alerts.blade.php b/resources/views/settings/alerts.blade.php index ddca5c8158f4..cdb22e7abfe1 100644 --- a/resources/views/settings/alerts.blade.php +++ b/resources/views/settings/alerts.blade.php @@ -176,7 +176,7 @@ - {{Form::close()}} + @stop diff --git a/resources/views/settings/asset_tags.blade.php b/resources/views/settings/asset_tags.blade.php index 020d97a7561a..df704cfe1371 100644 --- a/resources/views/settings/asset_tags.blade.php +++ b/resources/views/settings/asset_tags.blade.php @@ -21,9 +21,12 @@ - {{ Form::open(['method' => 'POST', 'files' => false, 'autocomplete' => 'off', 'class' => 'form-horizontal', 'role' => 'form' ]) }} - - {{csrf_field()}} +
@@ -106,6 +109,6 @@
- {{Form::close()}} +
@stop diff --git a/resources/views/settings/backups.blade.php b/resources/views/settings/backups.blade.php index 6313a6e404ee..3648311b74f8 100644 --- a/resources/views/settings/backups.blade.php +++ b/resources/views/settings/backups.blade.php @@ -158,13 +158,12 @@ class="btn btn-warning btn-sm restore-backup {{ (config('app.lock_passwords')) ? @if (config('app.lock_passwords')===true)

{{ trans('general.feature_disabled') }}

@else - - {{ Form::open([ - 'method' => 'POST', - 'route' => 'settings.backups.upload', - 'files' => true, - 'class' => 'form-horizontal' ]) }} - @csrf + +
@@ -193,8 +192,8 @@ class="btn btn-warning btn-sm restore-backup {{ (config('app.lock_passwords')) ?
- - {{ Form::close() }} + +
@endif diff --git a/resources/views/settings/branding.blade.php b/resources/views/settings/branding.blade.php index c586917ef534..eeabe42888f4 100644 --- a/resources/views/settings/branding.blade.php +++ b/resources/views/settings/branding.blade.php @@ -21,9 +21,15 @@ - {{ Form::open(['method' => 'POST', 'files' => true, 'autocomplete' => 'off', 'class' => 'form-horizontal', 'role' => 'form', 'id' => 'create-form' ]) }} - - {{csrf_field()}} + +
@@ -319,7 +325,7 @@
- {{Form::close()}} +
@stop diff --git a/resources/views/settings/general.blade.php b/resources/views/settings/general.blade.php index 1de5d4035d85..82f8e2c1baba 100644 --- a/resources/views/settings/general.blade.php +++ b/resources/views/settings/general.blade.php @@ -422,7 +422,7 @@ - {{ Form::close() }} + @stop diff --git a/resources/views/settings/google.blade.php b/resources/views/settings/google.blade.php index 83e88b936f13..f19d3eef485f 100644 --- a/resources/views/settings/google.blade.php +++ b/resources/views/settings/google.blade.php @@ -16,9 +16,12 @@ - {{ Form::open(['method' => 'POST', 'files' => false, 'autocomplete' => 'off', 'class' => 'form-horizontal', 'role' => 'form' ]) }} - - {{csrf_field()}} +
@@ -113,6 +116,6 @@
- {{Form::close()}} +
@stop diff --git a/resources/views/settings/labels.blade.php b/resources/views/settings/labels.blade.php index fa8c5dc858b2..61fce7c34c39 100644 --- a/resources/views/settings/labels.blade.php +++ b/resources/views/settings/labels.blade.php @@ -20,9 +20,13 @@ } - {{ Form::open(['id' => 'settingsForm', 'method' => 'POST', 'files' => false, 'autocomplete' => 'off', 'class' => 'form-horizontal', 'role' => 'form' ]) }} - - {{csrf_field()}} +
@@ -342,7 +346,7 @@ class="table table-striped snipe-table" - {{ Form::open(['method' => 'POST', 'files' => false, 'autocomplete' => 'off', 'class' => 'form-horizontal', 'role' => 'form' ]) }} + {{csrf_field()}} @@ -513,7 +517,7 @@ class="table table-striped snipe-table"
- {{Form::close()}} +
@stop diff --git a/resources/views/settings/ldap.blade.php b/resources/views/settings/ldap.blade.php index 5b483f48a2ea..999d8fa49ff5 100644 --- a/resources/views/settings/ldap.blade.php +++ b/resources/views/settings/ldap.blade.php @@ -829,7 +829,7 @@ - {{Form::close()}} + @endsection diff --git a/resources/views/settings/localization.blade.php b/resources/views/settings/localization.blade.php index d8f3e436e30e..da7dd8be531e 100644 --- a/resources/views/settings/localization.blade.php +++ b/resources/views/settings/localization.blade.php @@ -21,9 +21,12 @@ - {{ Form::open(['method' => 'POST', 'files' => false, 'autocomplete' => 'off', 'class' => 'form-horizontal', 'role' => 'form' ]) }} - - {{csrf_field()}} +
@@ -113,7 +116,7 @@
- {{Form::close()}} +
@stop diff --git a/resources/views/settings/purge-form.blade.php b/resources/views/settings/purge-form.blade.php index 86ad28fc5068..7ba65b91199d 100644 --- a/resources/views/settings/purge-form.blade.php +++ b/resources/views/settings/purge-form.blade.php @@ -22,9 +22,12 @@ {{ trans('admin/settings/general.purge') }} - {{ Form::open(['method' => 'POST', 'files' => false, 'autocomplete' => 'off', 'class' => 'form-horizontal', 'role' => 'form' ]) }} - - {{csrf_field()}} +

{{ trans('admin/settings/general.confirm_purge_help') }}

@@ -45,11 +48,10 @@ - {{ Form::close() }} +
- {{Form::close()}} @stop diff --git a/resources/views/settings/saml.blade.php b/resources/views/settings/saml.blade.php index 9349023fc814..f770d37fae1b 100644 --- a/resources/views/settings/saml.blade.php +++ b/resources/views/settings/saml.blade.php @@ -21,9 +21,13 @@ - {{ Form::open(['method' => 'POST', 'files' => false, 'autocomplete' => 'false', 'class' => 'form-horizontal', 'role' => 'form']) }} - - {{csrf_field()}} + + @@ -187,7 +191,7 @@ - {{Form::close()}} + @stop diff --git a/resources/views/settings/security.blade.php b/resources/views/settings/security.blade.php index a51c86fccbd5..f254be88b4a1 100644 --- a/resources/views/settings/security.blade.php +++ b/resources/views/settings/security.blade.php @@ -190,6 +190,6 @@ - {{Form::close()}} + @stop diff --git a/resources/views/statuslabels/view.blade.php b/resources/views/statuslabels/view.blade.php index a15fc8edd183..a86fa8234ed6 100644 --- a/resources/views/statuslabels/view.blade.php +++ b/resources/views/statuslabels/view.blade.php @@ -40,7 +40,6 @@ class="table table-striped snipe-table" - {{ Form::close() }} diff --git a/resources/views/users/index.blade.php b/resources/views/users/index.blade.php index 28cbc30f70a6..a26a8d0882f4 100755 --- a/resources/views/users/index.blade.php +++ b/resources/views/users/index.blade.php @@ -68,7 +68,6 @@ class="table table-striped snipe-table" - {{ Form::close() }} @@ -82,4 +81,4 @@ class="table table-striped snipe-table" @include ('partials.bootstrap-table') -@stop \ No newline at end of file +@stop