First code for #2723

This commit is contained in:
James Cole
2019-12-20 21:01:27 +01:00
parent b4af70421d
commit be2794406c
13 changed files with 567 additions and 101 deletions

View File

@@ -150,6 +150,21 @@ class Account extends Model
return $this->belongsTo(AccountType::class);
}
/**
* Get the account number.
*
* @return string
*/
public function getAccountNumberAttribute(): ?string
{
/** @var AccountMeta $metaValue */
$metaValue = $this->accountMeta()
->where('name', 'account_number')
->first();
return $metaValue ? $metaValue->data : null;
}
/**
* @return string
* @codeCoverageIgnore