mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2024-12-31 19:27:51 -06:00
29 lines
687 B
PHP
29 lines
687 B
PHP
<?php
|
|
|
|
|
|
class Transaction extends Elegant
|
|
{
|
|
public static $rules
|
|
= [
|
|
'account_id' => 'numeric|required|exists:accounts,id',
|
|
'transaction_journal_id' => 'numeric|required|exists:transaction_journals,id',
|
|
'description' => 'between:1,255',
|
|
'amount' => 'required|between:-65536,65536',
|
|
];
|
|
|
|
|
|
public function account()
|
|
{
|
|
return $this->belongsTo('Account');
|
|
}
|
|
|
|
public function transactionJournal()
|
|
{
|
|
return $this->belongsTo('TransactionJournal');
|
|
}
|
|
|
|
public function components()
|
|
{
|
|
return $this->belongsToMany('Component');
|
|
}
|
|
}
|