Skip to content

Commit

Permalink
feat: Updated app/Models/Invoice.php
Browse files Browse the repository at this point in the history
  • Loading branch information
sweep-ai[bot] committed Mar 11, 2024
1 parent 857c21e commit a44597f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions app/Models/Invoice.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,9 @@ class Invoice extends Model
protected $table = 'invoices';

protected $fillable = [
'customer_id',
'order_id',
'invoice_date',
'total_amount',
'payment_status',
];

public function order()
Expand All @@ -30,3 +28,11 @@ public function customer()
return $this->belongsTo(Customer::class);
}
}
protected $casts = [
'invoice_date' => 'datetime',
];

public function products()
{
return $this->belongsToMany(Product::class)->withPivot('quantity', 'price');
}

0 comments on commit a44597f

Please sign in to comment.