buid new app

This commit is contained in:
2026-03-09 01:00:49 +08:00
commit 97aed742af
126 changed files with 19341 additions and 0 deletions

42
app/Models/Expense.php Normal file
View File

@@ -0,0 +1,42 @@
<?php
namespace App\Models;
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',
];
protected $casts = [
'date' => 'date:Y-m-d',
'amount' => 'decimal:2',
];
public function user()
{
return $this->belongsTo(User::class);
}
public function category()
{
return $this->belongsTo(Category::class);
}
public function subcategory()
{
return $this->belongsTo(Category::class, 'subcategory_id');
}
}