2014-08-18 05:28:33 -05:00
|
|
|
<?php
|
|
|
|
|
|
|
|
use LaravelBook\Ardent\Ardent as Ardent;
|
|
|
|
|
2014-08-21 00:21:56 -05:00
|
|
|
/**
|
|
|
|
* PiggybankEvent
|
|
|
|
*
|
2014-08-31 00:32:48 -05:00
|
|
|
* @property integer $id
|
|
|
|
* @property \Carbon\Carbon $created_at
|
|
|
|
* @property \Carbon\Carbon $updated_at
|
|
|
|
* @property integer $piggybank_id
|
|
|
|
* @property \Carbon\Carbon $date
|
|
|
|
* @property float $amount
|
2014-08-21 00:21:56 -05:00
|
|
|
* @property-read \Piggybank $piggybank
|
2014-08-28 00:53:54 -05:00
|
|
|
* @method static \Illuminate\Database\Query\Builder|\PiggybankEvent whereId($value)
|
|
|
|
* @method static \Illuminate\Database\Query\Builder|\PiggybankEvent whereCreatedAt($value)
|
|
|
|
* @method static \Illuminate\Database\Query\Builder|\PiggybankEvent whereUpdatedAt($value)
|
|
|
|
* @method static \Illuminate\Database\Query\Builder|\PiggybankEvent wherePiggybankId($value)
|
|
|
|
* @method static \Illuminate\Database\Query\Builder|\PiggybankEvent whereDate($value)
|
|
|
|
* @method static \Illuminate\Database\Query\Builder|\PiggybankEvent whereAmount($value)
|
2014-08-21 00:21:56 -05:00
|
|
|
*/
|
2014-08-18 05:28:33 -05:00
|
|
|
class PiggybankEvent extends Ardent
|
|
|
|
{
|
|
|
|
|
2014-08-21 14:00:02 -05:00
|
|
|
public static $rules
|
|
|
|
= [
|
|
|
|
'piggybank_id' => 'required|exists:piggybanks,id',
|
|
|
|
'date' => 'required|date',
|
|
|
|
'amount' => 'required|numeric'
|
2014-08-18 05:28:33 -05:00
|
|
|
];
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
public function getDates()
|
|
|
|
{
|
|
|
|
return ['created_at', 'updated_at', 'date'];
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
|
|
|
*/
|
|
|
|
public function piggybank()
|
|
|
|
{
|
|
|
|
return $this->belongsTo('Piggybank');
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|