Merge pull request #16235 from marcusmoore/chore/migrate-form-open-pt1

Replace Form::open and Form::close pt1
This commit is contained in:
snipe 2025-02-18 20:23:47 +00:00 committed by GitHub
commit e814cd5a9e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 22 additions and 26 deletions

View file

@ -11,7 +11,7 @@
<div class="row">
<div class="col-md-9">
{{ Form::open(['method' => 'POST', 'files' => true, 'class' => 'form-horizontal', 'autocomplete' => 'off']) }}
<form method="POST" action="{{ route('account.password.update') }}" accept-charset="UTF-8" class="form-horizontal" autocomplete="off">
<!-- CSRF Token -->
<input type="hidden" name="_token" value="{{ csrf_token() }}" />
<div class="box box-default">
@ -63,7 +63,7 @@
</div>
</div> <!-- .box-default -->
{{ Form::close() }}
</form>
</div> <!-- .col-md-9 -->
</div> <!-- .row-->
@stop

View file

@ -10,7 +10,7 @@
<div class="row">
<div class="col-md-9">
{{ Form::open(['method' => 'POST', 'files' => true, 'class' => 'form-horizontal', 'autocomplete' => 'off']) }}
<form method="POST" action="{{ route('profile.update') }}" accept-charset="UTF-8" class="form-horizontal" autocomplete="off" enctype="multipart/form-data">
<!-- CSRF Token -->
<input type="hidden" name="_token" value="{{ csrf_token() }}" />
<div class="box box-default">
@ -187,7 +187,7 @@
<button type="submit" class="btn btn-primary"><x-icon type="checkmark" /> {{ trans('general.save') }}</button>
</div>
</div> <!-- .box-default -->
{{ Form::close() }}
</form>
</div> <!-- .col-md-9 -->
</div> <!-- .row-->

View file

@ -23,10 +23,10 @@
<!-- Horizontal Form -->
@if ($field->id)
{{ Form::open(['route' => ['fields.update', $field->id], 'class'=>'form-horizontal']) }}
<form method="POST" action="{{ route('fields.update', $field->id) }}" accept-charset="UTF-8" class="form-horizontal">
{{ method_field('PUT') }}
@else
{{ Form::open(['route' => 'fields.store', 'class'=>'form-horizontal']) }}
<form method="POST" action="{{ route('fields.store') }}" accept-charset="UTF-8" class="form-horizontal">
@endif
@csrf
@ -269,7 +269,7 @@
</div>
{{ Form::close() }}
</form>
@stop
@section('moar_scripts')

View file

@ -88,11 +88,8 @@
<tfoot>
<tr>
<td colspan="8">
{{ Form::open(['route' =>
["fieldsets.associate",$custom_fieldset->id],
'class'=>'form-inline',
'id' => 'ordering']) }}
<form method="POST" action="{{ route('fieldsets.associate', $custom_fieldset->id) }}" accept-charset="UTF-8" class="form-inline" id="ordering">
@csrf
<div class="form-group">
<label for="field_id" class="sr-only">
@ -118,7 +115,7 @@
<button type="submit" class="btn btn-primary"> {{ trans('general.save') }}</button>
</span>
{{ Form::close() }}
</form>
</td>
</tr>

View file

@ -87,13 +87,15 @@
@endcan
@can('delete', $fieldset)
{{ Form::open(['route' => array('fieldsets.destroy', $fieldset->id), 'method' => 'delete','style' => 'display:inline-block']) }}
<form method="POST" action="{{ route('fieldsets.destroy', $fieldset->id) }}" accept-charset="UTF-8" style="display:inline-block">
{{ method_field('DELETE') }}
@csrf
@if($fieldset->models->count() > 0)
<button type="submit" class="btn btn-danger btn-sm disabled" data-tooltip="true" title="{{ trans('general.cannot_be_deleted') }}" disabled><i class="fas fa-trash"></i></button>
@else
<button type="submit" class="btn btn-danger btn-sm" data-tooltip="true" title="{{ trans('general.delete') }}"><i class="fas fa-trash"></i></button>
@endif
{{ Form::close() }}
</form>
@endcan
</nobr>
</td>
@ -192,7 +194,9 @@
</td>
<td>
<nobr>
{{ Form::open(array('route' => array('fields.destroy', $field->id), 'method' => 'delete', 'style' => 'display:inline-block')) }}
<form method="POST" action="{{ route('fields.destroy', $field->id) }}" accept-charset="UTF-8" style="display:inline-block">
{{ method_field('DELETE') }}
@csrf
@can('update', $field)
<a href="{{ route('fields.edit', $field->id) }}" class="btn btn-warning btn-sm" data-tooltip="true" title="{{ trans('general.update') }}">
<i class="fas fa-pencil-alt" aria-hidden="true"></i>
@ -214,7 +218,7 @@
@endif
@endcan
{{ Form::close() }}
</form>
</nobr>
</td>
</tr>

View file

@ -129,13 +129,8 @@
<div class="tab-pane" id="models">
<div class="row">
{{ Form::open(
[
'method' => 'POST',
'route' => ['models.bulkedit.index'],
'class' => 'form-inline',
'id' => 'bulkForm']
) }}
<form method="POST" action="{{ route('models.bulkedit.index') }}" accept-charset="UTF-8" class="form-inline" id="bulkForm">
@csrf
<div class="col-md-12">
<div id="toolbar">
<label for="bulk_actions" class="sr-only">{{ trans('general.bulk_actions') }}</label>

View file

@ -280,12 +280,12 @@ Route::group(['prefix' => 'account', 'middleware' => ['auth']], function () {
// Profile
Route::get('profile', [ProfileController::class, 'getIndex'])->name('profile');
Route::post('profile', [ProfileController::class, 'postIndex']);
Route::post('profile', [ProfileController::class, 'postIndex'])->name('profile.update');
Route::get('menu', [ProfileController::class, 'getMenuState'])->name('account.menuprefs');
Route::get('password', [ProfileController::class, 'password'])->name('account.password.index');
Route::post('password', [ProfileController::class, 'passwordSave']);
Route::post('password', [ProfileController::class, 'passwordSave'])->name('account.password.update');
Route::get('api', [ProfileController::class, 'api'])->name('user.api');