mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-01-05 21:53:08 -06:00
41 lines
863 B
PHP
41 lines
863 B
PHP
|
<?php
|
||
|
|
||
|
use LaravelBook\Ardent\Ardent as Ardent;
|
||
|
|
||
|
class Limit extends Ardent
|
||
|
{
|
||
|
|
||
|
public static $rules
|
||
|
= [
|
||
|
'component_id' => 'required|exists:components,id',
|
||
|
'startdate' => 'required|date',
|
||
|
'enddate' => 'required|date',
|
||
|
'amount' => 'numeric|required|min:0.01'
|
||
|
|
||
|
];
|
||
|
|
||
|
public static $factory
|
||
|
= [
|
||
|
'component_id' => 'factory|Budget',
|
||
|
'startdate' => 'date',
|
||
|
'enddate' => 'date',
|
||
|
'amount' => '100'
|
||
|
];
|
||
|
|
||
|
public function component()
|
||
|
{
|
||
|
return $this->belongsTo('Component');
|
||
|
}
|
||
|
|
||
|
public function budget()
|
||
|
{
|
||
|
return $this->belongsTo('Budget', 'component_id');
|
||
|
}
|
||
|
|
||
|
public function getDates()
|
||
|
{
|
||
|
return ['created_at', 'updated_at', 'startdate', 'enddate'];
|
||
|
}
|
||
|
|
||
|
|
||
|
}
|