© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
24 replies
alexmanase

Call to undefined method Illuminate\Database\Eloquent\Relations\BelongsToMany::getOwnerKeyName()

Hi there! Created a simple BelgonsToMany relationship like in Laravel Documentation(https://laravel.com/docs/10.x/eloquent-relationships#many-to-many-defining-the-inverse-of-the-relationship) and I've got the following error:

Call to undefined method Illuminate\Database\Eloquent\Relations\BelongsToMany::getOwnerKeyName()
Call to undefined method Illuminate\Database\Eloquent\Relations\BelongsToMany::getOwnerKeyName()


I've used the example from the FIlament documentation for creating a Select:

 Forms\Components\Select::make('projects')
                    ->relationship('projects', 'name'),
 Forms\Components\Select::make('projects')
                    ->relationship('projects', 'name'),


https://flareapp.io/share/Lm8MOMpP

Thank you!
Flare
Call to undefined method Illuminate\Database\Eloquent\Relations\BelongsToMany::getOwnerKeyName() - The error occurred at http://disponibilitati.test/admin/apartments/create
Laravel - The PHP Framework For Web Artisans
Laravel is a PHP web application framework with expressive, elegant syntax. We’ve already laid the foundation — freeing you to create without sweating the small things.
Laravel - The PHP Framework For Web Artisans
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

Call to undefined method Illuminate\Database\Eloquent\Relations\MorphOne::getQualifiedOwnerKeyName()
FilamentFFilament / ❓┊help
2y ago
Call to undefined method Illuminate\Database\Eloquent\Relations\BelongsTo::save()
FilamentFFilament / ❓┊help
3y ago
Call to undefined method Illuminate\Database\Eloquent\Builder::withoutTrashed()
FilamentFFilament / ❓┊help
3y ago
[phpStan] Illuminate\Database\Eloquent\Model::$id.
FilamentFFilament / ❓┊help
2y ago