mirror of
https://github.com/crater-invoice/crater.git
synced 2025-12-15 09:52:55 -05:00
v6 update
This commit is contained in:
@@ -16,6 +16,10 @@ class Expense extends Model implements HasMedia
|
||||
use InteractsWithMedia;
|
||||
use HasCustomFieldsTrait;
|
||||
|
||||
protected $dates = [
|
||||
'expense_date',
|
||||
];
|
||||
|
||||
protected $guarded = ['id'];
|
||||
|
||||
protected $appends = [
|
||||
@@ -30,13 +34,6 @@ class Expense extends Model implements HasMedia
|
||||
'exchange_rate' => 'float'
|
||||
];
|
||||
|
||||
public function setExpenseDateAttribute($value)
|
||||
{
|
||||
if ($value) {
|
||||
$this->attributes['expense_date'] = Carbon::createFromFormat('Y-m-d', $value);
|
||||
}
|
||||
}
|
||||
|
||||
public function category()
|
||||
{
|
||||
return $this->belongsTo(ExpenseCategory::class, 'expense_category_id');
|
||||
|
||||
Reference in New Issue
Block a user