© 2026 Hedgehog Software, LLC

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

AttachAction select different relationship?

I have two models with a
BelongsToMany
BelongsToMany
relationship:
Account
Account
and
AccountCollection
AccountCollection
.

I also have an
AccountsRelationManager
AccountsRelationManager
on an
AccountCollectionResource
AccountCollectionResource
.

I have a relationship setup on the
Account
Account
model called
collections()
collections()
rather than the Laravel naming convention of
accountCollections()
accountCollections()
. When I try to attach an account on the relation manager, I get the following error:

Call to undefined method App\Models\Crm\Account::accountCollections()

It seems the
AttachAction
AttachAction
is looking for a relationship that doesn't exist. How can I fix this without renaming my relationship? Is there an option on the
AttachAction
AttachAction
I can use?
Solution
Never mind, found it in the documentation. Just needed better keywords for the search 😄

https://filamentphp.com/docs/3.x/panels/resources/relation-managers#unconventional-inverse-relationship-names
Managing relationships - Panel Builder - Filament
Jump to solution
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

ManyToMany Relationship on AttachAction
FilamentFFilament / ❓┊help
2y ago
Relationship Manager AttachAction custom form
FilamentFFilament / ❓┊help
2y ago
Select relationship
FilamentFFilament / ❓┊help
3y ago
AttachAction select contains no label
FilamentFFilament / ❓┊help
11mo ago