Skip to content

Commit 90f1482

Browse files
authored
Merge pull request #5521 from Laravel-Backpack/register-field-events-on-update-form
Register field events on UpdateOperation edit form
2 parents 1fe921d + f442606 commit 90f1482

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/app/Http/Controllers/Operations/UpdateOperation.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,16 @@ protected function setupUpdateDefaults()
6363
public function edit($id)
6464
{
6565
$this->crud->hasAccessOrFail('update');
66+
6667
// get entry ID from Request (makes sure its the last ID for nested resources)
6768
$id = $this->crud->getCurrentEntryId() ?? $id;
68-
// get the info for that entry
6969

70+
// register any Model Events defined on fields
71+
$this->crud->registerFieldEvents();
72+
73+
// get the info for that entry
7074
$this->data['entry'] = $this->crud->getEntryWithLocale($id);
75+
7176
$this->crud->setOperationSetting('fields', $this->crud->getUpdateFields());
7277

7378
$this->data['crud'] = $this->crud;

0 commit comments

Comments
 (0)