SET
SET
FFilament
Created by SET on 3/2/2024 in #❓┊help
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)?
2 replies
FFilament
Created by SET on 2/4/2024 in #❓┊help
Dynamic form with TextInput's
I have a question here https://github.com/filamentphp/filament/issues/11029 And I have answer, but... For some reason, the code only works if I set Select with default value.
8 replies