Files
exchange-2.0/app/Models/AccountStatement.php
T

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);
}
}