© 2026 Hedgehog Software, LLC

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

Many relationship manager?

In my database I have brands and products

I have a resource called Brand, and have tried making a relationship manager for Products. However, on my Brands table I don't have any product ids, because it can have hundreds.

my products table has a brand_id column

How do i properly set up this relationship in filament? Do I need to create an in between table?
Solution
php artisan make:filament-relation-manager BrandResource products name
php artisan make:filament-relation-manager BrandResource products name


Brand Model
public function products(): HasMany
{
    return $this->hasMany(Product::class);
}
public function products(): HasMany
{
    return $this->hasMany(Product::class);
}


Product Model
public function brand(): BelongsTo
{
    return $this->belongsTo(Brand::class);
}
public function brand(): BelongsTo
{
    return $this->belongsTo(Brand::class);
}
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

Relation manager Many to Many relationship
FilamentFFilament / ❓┊help
3y ago
Trouble with Relation Manager for Many-to-Many Relationship
FilamentFFilament / ❓┊help
2y ago
relationship manager
FilamentFFilament / ❓┊help
2y ago
many to many relationship
FilamentFFilament / ❓┊help
16mo ago