mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-01-08 07:03:23 -06:00
39 lines
818 B
PHP
39 lines
818 B
PHP
<?php
|
|
use Watson\Validating\ValidatingTrait;
|
|
|
|
class PiggybankEvent extends Eloquent
|
|
{
|
|
|
|
use ValidatingTrait;
|
|
public static $rules
|
|
= [
|
|
'piggybank_id' => 'required|exists:piggybanks,id',
|
|
'date' => 'required|date',
|
|
'amount' => 'required|numeric'
|
|
];
|
|
|
|
/**
|
|
* @return array
|
|
*/
|
|
public function getDates()
|
|
{
|
|
return ['created_at', 'updated_at', 'date'];
|
|
}
|
|
|
|
/**
|
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
|
*/
|
|
public function piggybank()
|
|
{
|
|
return $this->belongsTo('Piggybank');
|
|
}
|
|
|
|
/**
|
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
|
*/
|
|
public function transactionJournal()
|
|
{
|
|
return $this->belongsTo('TransactionJournal');
|
|
}
|
|
|
|
}
|