fix dependent fields

This commit is contained in:
Dan Harrin
2021-03-24 18:36:34 +00:00
parent 898eb7af7b
commit 42314bd9d5
@@ -10,7 +10,7 @@ trait CanBeDependentOnResourceRecord
if (! $callback) {
$this->hidden();
$callback = fn ($component) => $component->visible();
$callback = fn ($component, $record) => $component->visible();
}
try {
@@ -20,7 +20,7 @@ trait CanBeDependentOnResourceRecord
}
if ($shouldExecuteCallback) {
$callback($this);
$callback($this, (object) $this->getLivewire()->record);
}
});