- Menambahkan model StmtEntry untuk mengelola data entri pernyataan. - Membuat migrasi untuk tabel stmt_entry dengan kolom yang diperlukan. - Menyediakan relasi dengan model Account melalui kolom account_number.
60 lines
1.2 KiB
PHP
60 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace Modules\Webstatement\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
// use Modules\Webstatement\Database\Factories\StmtEntryFactory;
|
|
|
|
class StmtEntry extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
/**
|
|
* The table associated with the model.
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $table = 'stmt_entry';
|
|
|
|
/**
|
|
* The attributes that are mass assignable.
|
|
*
|
|
* @var array
|
|
*/
|
|
protected $fillable = [
|
|
'stmt_entry_id',
|
|
'account_number',
|
|
'company_code',
|
|
'amount_lcy',
|
|
'transaction_code',
|
|
'narrative',
|
|
'product_category',
|
|
'value_date',
|
|
'amount_fcy',
|
|
'exchange_rate',
|
|
'trans_reference',
|
|
'booking_date',
|
|
'stmt_no',
|
|
'date_time',
|
|
'currency',
|
|
'crf_type',
|
|
'consol_key',
|
|
];
|
|
|
|
/**
|
|
* The attributes that should be cast.
|
|
*
|
|
* @var array
|
|
*/
|
|
protected $casts = [
|
|
'created_at' => 'datetime',
|
|
'updated_at' => 'datetime',
|
|
];
|
|
|
|
public function account()
|
|
{
|
|
return $this->belongsTo(Account::class, 'account_number', 'account_number');
|
|
}
|
|
}
|