mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
- Full move to high charts.
- Cleanup homepage. - Expanded libraries - Added limits (for budgets) - Extended models - Added popups for charts. - [skip-ci]
This commit is contained in:
41
app/models/Limit.php
Normal file
41
app/models/Limit.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?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'];
|
||||
}
|
||||
|
||||
|
||||
}
|
Reference in New Issue
Block a user