mirror of
https://github.com/henry4682/finance_app.git
synced 2026-07-16 00:10:00 +00:00
feat: 前端分離+功能api化
1. 新增資產管理CRUD、googleOAuth登入 2. 更改原記帳controller
This commit is contained in:
@@ -7,18 +7,18 @@ use Illuminate\Database\Eloquent\Model;
|
||||
class Expense extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'user_id',
|
||||
'category_id',
|
||||
'subcategory_id',
|
||||
'type',
|
||||
'amount',
|
||||
'note',
|
||||
'date',
|
||||
'invoice_number',
|
||||
'seller_name',
|
||||
'item_name',
|
||||
'external_id',
|
||||
];
|
||||
'user_id',
|
||||
'amount',
|
||||
'category_id',
|
||||
'item_name',
|
||||
'date',
|
||||
'note',
|
||||
'seller_name',
|
||||
'account_id',
|
||||
'is_amortized',
|
||||
'period_start',
|
||||
'period_end',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'date' => 'date:Y-m-d',
|
||||
@@ -39,4 +39,9 @@ class Expense extends Model
|
||||
{
|
||||
return $this->belongsTo(Category::class, 'subcategory_id');
|
||||
}
|
||||
|
||||
public function account()
|
||||
{
|
||||
return $this->belongsTo(Account::class);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user