Skip to content

Commit 3de5eeb

Browse files
authored
Merge pull request #5829 from Laravel-Backpack/pass-the-form-id-to-form-content
pass the form id to form content
2 parents 81e2317 + 5958bdb commit 3de5eeb

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/resources/views/crud/create.blade.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@
4444
{!! csrf_field() !!}
4545
{{-- load the view from the application if it exists, otherwise load the one in the package --}}
4646
@if(view()->exists('vendor.backpack.crud.form_content'))
47-
@include('vendor.backpack.crud.form_content', [ 'fields' => $crud->fields(), 'action' => 'create' ])
47+
@include('vendor.backpack.crud.form_content', [ 'fields' => $crud->fields(), 'action' => 'create', 'id' => $id ?? null])
4848
@else
49-
@include('crud::form_content', [ 'fields' => $crud->fields(), 'action' => 'create' ])
49+
@include('crud::form_content', [ 'fields' => $crud->fields(), 'action' => 'create', 'id' => $id ?? null])
5050
@endif
5151
{{-- This makes sure that all field assets are loaded. --}}
5252
<div class="d-none" id="parentLoadedAssets">{{ json_encode(Basset::loaded()) }}</div>

src/resources/views/crud/edit.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
@if(view()->exists('vendor.backpack.crud.form_content'))
4646
@include('vendor.backpack.crud.form_content', ['fields' => $crud->fields(), 'action' => 'edit', 'id' => $id ?? null])
4747
@else
48-
@include('crud::form_content', ['fields' => $crud->fields(), 'action' => 'edit'])
48+
@include('crud::form_content', ['fields' => $crud->fields(), 'action' => 'edit', 'id' => $id ?? null])
4949
@endif
5050
{{-- This makes sure that all field assets are loaded. --}}
5151
<div class="d-none" id="parentLoadedAssets">{{ json_encode(Basset::loaded()) }}</div>

0 commit comments

Comments
 (0)