© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
9 replies
Pablo Torres

One to Many Relationship. Implementing --associate

'''
Hi,
I have,

Tables:
businesses
briefcases

So, a briefcase can have many business.

Business Model:
  public function briefcase(): belongsTo
  {
      return $this->belongsTo(Briefcase::class);
  }
  public function briefcase(): belongsTo
  {
      return $this->belongsTo(Briefcase::class);
  }


Briefcase Model:
  public function businesses(): hasMany
  {
      return $this->hasMany(Business::class);
  }
  public function businesses(): hasMany
  {
      return $this->hasMany(Business::class);
  }


Relation Manager --associate:
php artisan make:filament-relation-manager BriefcaseResource businesses name --view --associate
php artisan make:filament-relation-manager BriefcaseResource businesses name --view --associate


When trying to associate a business I get:
Call to undefined method App\Models\Business::briefcases()
Call to undefined method App\Models\Business::briefcases()


Any suggestions?
Thank you.
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

One to many polymorphic relationship
FilamentFFilament / ❓┊help
2y ago
Associate BelongsTo relationship
FilamentFFilament / ❓┊help
3y ago
Relationship many to many
FilamentFFilament / ❓┊help
2y ago
Many to many Relationship
FilamentFFilament / ❓┊help
3y ago