Skip to content

Commit

Permalink
Fix: bug in relationship fields
Browse files Browse the repository at this point in the history
  • Loading branch information
awcodes committed Nov 4, 2022
1 parent 62a8d62 commit 8c967a6
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/Http/Livewire/QuickCreateMenu.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace FilamentQuickCreate\Http\Livewire;

use Filament\Forms\ComponentContainer;
use Filament\Pages\Actions\CreateAction;
use Filament\Pages\Page;
use Filament\Support\Exceptions\Cancel;
Expand Down Expand Up @@ -144,6 +145,25 @@ public function mountAction(string $name)
]);
}

public function getMountedActionForm(): ?ComponentContainer
{
$action = $this->getMountedAction();

if (! $action) {
return null;
}

if ((! $this->isCachingForms) && $this->hasCachedForm('mountedActionForm')) {
return $this->getCachedForm('mountedActionForm');
}

return $this->makeForm()
->schema($action->getFormSchema())
->statePath('mountedActionData')
->model($action->getModel())
->context($this->mountedAction);
}

public function getFilamentResources(): array
{
$resources = collect(QuickCreateFacade::getResources())
Expand Down

0 comments on commit 8c967a6

Please sign in to comment.