This commit is contained in:
Ludovic CANDELLIER
2023-08-28 21:48:04 +02:00
parent 1cba52bb6d
commit f721422abc
11 changed files with 42 additions and 50 deletions

View File

@@ -31,7 +31,12 @@ class Invoice extends Model
public function customer()
{
return $this->belongsToThrough(Customer::class, Order::class, null, '', [Customer::class => 'customer_id', Order::class => 'order_id']);
return $this->belongsTo(Customer::class, 'customer_id');
}
public function address()
{
return $this->belongsTo(CustomerAddress::class, 'invoice_address_id');
}
public function scopeByUUID($query, $uuid)