© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
2 replies
erikms61

Reused form fields do not seem to follow model relationships

Hi all,
I am trying to open a form defined in one Resource, via an action in another Resource. This does not work if a field uses a relationship.
For a test, I created a fresh install with two Models: Een and Twee, where Twee contains a reference to Een. Will put it on Github if needed.
The Resources contain a TextInput each, and TweeResource contains a Select to select the referenced Een. This works fine while in the Twee Admin page. The problem arises when I try to open the Twee form in the Een Admin page via an Action.
The error is "Filament\Support\Services\RelationshipJoiner::prepareQueryForNoConstraints(): Argument #1 ($relationship) must be of type Illuminate\Database\Eloquent\Relations\Relation, null given, called in ... vendor/filament/forms/src/Components/Select.php on line 770"

Questions:
- what am I doing wrong?
- How should I indicate that there is a relation between Twee and Een?
- I would assume that the form definition takes care of that... shouldn't it?

(2000 character limit, code in attachment)
code-snippets.php1.47KB
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

How do form fields with relationships work?
FilamentFFilament / ❓┊help
2y ago
Nesting form fields depending on relationships
FilamentFFilament / ❓┊help
2y ago
Form relationships
FilamentFFilament / ❓┊help
2y ago
Conditional form relationships
FilamentFFilament / ❓┊help
3y ago