Add ignoreRecord to CopyFrom relationships (#1964)

This commit is contained in:
MartinOscar 2025-12-06 19:17:05 +00:00 committed by GitHub
parent 27b896c6d2
commit 25d8adbcc6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -28,7 +28,7 @@ class CopyFrom extends Select
{
$this->helperText(trans('admin/egg.copy_from_help'));
$this->relationship('configFrom', 'name');
$this->relationship('configFrom', 'name', ignoreRecord: true);
$this->afterStateUpdated(function ($state, Set $set) {
$set('copy_script_from', $state);
@ -52,7 +52,7 @@ class CopyFrom extends Select
public function script(): static
{
$this->relationship('scriptFrom', 'name');
$this->relationship('scriptFrom', 'name', ignoreRecord: true);
$this->afterStateUpdated(function ($state, Set $set, Component $livewire) {
if ($state === null) {