© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
1 reply
SET

Relation Manager through relation

I have three models:
Order
Order
,
OrderItem
OrderItem
and
Invoice.
Invoice.

Order.php:
public function order_items(): hasMany
{
    return $this->hasMany(OrderItem::class);
} 
public function order_items(): hasMany
{
    return $this->hasMany(OrderItem::class);
} 

OrderItem.php:
public function invoices(): belongsToMany
{
    return $this->belongsToMany(Invoice::class)->withPivot([
        "quantity",
        "unit",
    ]);
}
public function invoices(): belongsToMany
{
    return $this->belongsToMany(Invoice::class)->withPivot([
        "quantity",
        "unit",
    ]);
}

Invoice.php
public function order_items(): belongsToMany
    {
        return $this->belongsToMany(OrderItem::class)->withPivot([
            "quantity",
            "unit",
        ]);
    }
public function order_items(): belongsToMany
    {
        return $this->belongsToMany(OrderItem::class)->withPivot([
            "quantity",
            "unit",
        ]);
    }

Order items have no separate page, I fill order items with repeater on order page. How can I display invoices with relation manager on the same page (with orders)?
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

Relation Manager
FilamentFFilament / ❓┊help
2y ago
Relation Manager
FilamentFFilament / ❓┊help
3y ago
Relation Manager
FilamentFFilament / ❓┊help
3y ago
Relation manager with intermediate relationship
FilamentFFilament / ❓┊help
3y ago