feat: initial commit

This commit is contained in:
JP
2024-08-05 08:04:35 +08:00
parent 0f3c3db73b
commit 140e821e0c
194 changed files with 14509 additions and 254 deletions

View File

@@ -0,0 +1,55 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
class Transaction extends Model
{
use HasFactory;
protected $guarded = [];
/**
* Get the expense that owns the Transaction
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function expense(): BelongsTo
{
return $this->belongsTo(Expense::class);
}
/**
* Get the sale that owns the Transaction
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function sale(): BelongsTo
{
return $this->belongsTo(Sale::class);
}
/**
* Get the account that owns the Transaction
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function account(): BelongsTo
{
return $this->belongsTo(Account::class);
}
/**
* Get the ledgers associated with the Transaction
*
* @return \Illuminate\Database\Eloquent\Relations\HasOne
*/
public function ledgers(): HasMany
{
return $this->hasMany(Ledger::class);
}
}