© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2mo ago
zaidpirwani

Create Resource from Linked Resource View Page - form error

Actions4️⃣v4
I have a working project on Filament v3, which I am moving to v4, there is a Purchase model, where people add Quotes. quotes are added by an Add Quote button on Purchase Resource View Page - there is a multi-step Wizard to add quotes.

On v3, it works fine, on v4, the Add Quote button (which is actually a CreateAction) opens the purchase Create page - ignoring model and provided steps method.

I changed it to simple Action and now the form mentioned in schema / steps is being opened, but it is checking for relationships on the current Purchase View model, resulting in error

user is test@example.com, testuser

Git: https://github.com/zaidpirwani/filament-v4-create-other-model-via-modal
Repo to reproduce error, with seeder, try making quote from Add Quote button on Purchase


Button Code on ViewPurchase.php
    protected function getHeaderActions(): array
    {
        return [
            EditAction::make(),
            Action::make('add_quote_action')
                ->modal()
                ->model(Quote::class)
                ->schema(QuoteForm::formComponents()),
            CreateAction::make('add_quote_create_action')
                ->modal()
                ->model(Quote::class)
                ->schema(QuoteForm::formComponents())
        ];
    }
    protected function getHeaderActions(): array
    {
        return [
            EditAction::make(),
            Action::make('add_quote_action')
                ->modal()
                ->model(Quote::class)
                ->schema(QuoteForm::formComponents()),
            CreateAction::make('add_quote_create_action')
                ->modal()
                ->model(Quote::class)
                ->schema(QuoteForm::formComponents())
        ];
    }


The Action throws error
LogicException
vendor\filament\forms\src\Components\Select.php:1289
The relationship [vendor] does not exist on the model [App\Models\Purchase].
LogicException
vendor\filament\forms\src\Components\Select.php:1289
The relationship [vendor] does not exist on the model [App\Models\Purchase].


The relationship is on quote which belongsTo Vendor and Purchase both, Purchase select relation is hidden on ViewPurchase and set when creating, Vendor needs to be selected in the modal


Create action shows Add Quote when I set model(Quote::class), but still it opens the Purchase Create Page URL at: https://filament-v4-create-other-model-via-modal.test/admin/purchases/create?record=1
ignores the modal() method as well.
message.txt9.5KB
GitHub
GitHub - zaidpirwani/filament-v4-create-other-model-via-modal: fila...
filament create action error replication. Contribute to zaidpirwani/filament-v4-create-other-model-via-modal development by creating an account on GitHub.
GitHub - zaidpirwani/filament-v4-create-other-model-via-modal: fila...
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

custom page form from resource
FilamentFFilament / ❓┊help
11mo ago
How to remove Form from View page
FilamentFFilament / ❓┊help
3y ago
Refresh page data from resource form action
FilamentFFilament / ❓┊help
15mo ago
Resource > Page > Create fails
FilamentFFilament / ❓┊help
11mo ago