mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-19 04:23:55 +00:00
46 lines
905 B
PHP
46 lines
905 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class AccountStatement extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $fillable = [
|
|
'statement_account_id',
|
|
'date_from',
|
|
'date_to',
|
|
'total_amount',
|
|
'begin_balance',
|
|
'end_balance',
|
|
'total_rows',
|
|
'mapped_rows',
|
|
];
|
|
|
|
/**
|
|
* Get the attributes that should be cast.
|
|
*
|
|
* @return array<string, string>
|
|
*/
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'date_from' => 'date',
|
|
'date_to' => 'date',
|
|
];
|
|
}
|
|
|
|
public function account()
|
|
{
|
|
return $this->belongsTo(StatementAccount::class, 'statement_account_id', 'id');
|
|
}
|
|
|
|
public function transactions()
|
|
{
|
|
return $this->hasMany(StatementTransaction::class);
|
|
}
|
|
}
|