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)
1 Reply
bump