F
Filament3mo ago
SET

Relation Manager through relation

I have three models: Order, OrderItem and 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)?
0 Replies
No replies yetBe the first to reply to this messageJoin