firefly-iii/app/models/PiggybankEvent.php

39 lines
818 B
PHP
Raw Normal View History

<?php
2014-12-06 05:12:55 -06:00
use Watson\Validating\ValidatingTrait;
2014-12-06 05:12:55 -06:00
class PiggybankEvent extends Eloquent
{
2014-12-06 05:12:55 -06:00
use ValidatingTrait;
public static $rules
2014-11-18 02:47:50 -06:00
= [
'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');
}
}