mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
- Cleanup homepage. - Expanded libraries - Added limits (for budgets) - Extended models - Added popups for charts. - [skip-ci]
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'];
|
|
}
|
|
|
|
|
|
}
|