This commit is contained in:
Utkarsh Khedkar
2026-03-13 23:06:51 +05:30
7 changed files with 164 additions and 102 deletions

View File

@@ -49,10 +49,10 @@ class Invoice extends Model
return $this->hasMany(InvoiceItem::class)->orderBy('id', 'ASC');
}
public function container()
{
return $this->belongsTo(Container::class);
}
// public function container()
// {
// return $this->belongsTo(Container::class);
// }
public function customer()
{
@@ -124,6 +124,10 @@ class Invoice extends Model
{
return $this->status === 'paid';
}
public function container()
{
return $this->belongsTo(\App\Models\Container::class, 'container_id');
}
}

View File

@@ -89,10 +89,7 @@ class User extends Authenticatable implements JWTSubject
{
return [];
}
public function invoices()
{
return $this->hasMany(\App\Models\Invoice::class, 'customer_id', 'customer_id');
}
// App\Models\User.php
@@ -108,6 +105,10 @@ public function invoiceInstallments()
);
}
public function invoices()
{
return $this->hasMany(\App\Models\Invoice::class, 'customer_id', 'id');
}
}