© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
8 replies
JimKarvo

Relationship problems? (relationship with where)

Hello,

I have this relationship at my model:

public function customer_price_change_beta()
    {
       return $this->hasOne(CustomerPriceChangesBeta::class, 'customer_id', 'customer_id')
            ->where('product_id', $this->product_id)
            ;
    }
public function customer_price_change_beta()
    {
       return $this->hasOne(CustomerPriceChangesBeta::class, 'customer_id', 'customer_id')
            ->where('product_id', $this->product_id)
            ;
    }


The relationships work very well outside filamentphp (eg at controller and lavarel's blade)

At filamentphp I get an empty string.

If I remove the where statement the relationship returns data (but it is wrong)

This is a Filament bug?
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

Problems figuring out BelongsToMany relationship
FilamentFFilament / ❓┊help
3y ago
Relationship with a relationship after create?
FilamentFFilament / ❓┊help
16mo ago
Filter not working when modify getEloquentQuery with where o whereBelongsTo
FilamentFFilament / ❓┊help
3y ago
error with relationship
FilamentFFilament / ❓┊help
2y ago