Some general cleaning up in the menu's and the various controllers. Added a new class (yet to be tested) and removed most of the "piggy bank"-implementation in anticipation of the ideas from issue #6. Fixed a bug in the default user seeder.

This commit is contained in:
James Cole
2014-08-13 07:02:13 +02:00
parent dbcf6613c6
commit e2940015ca
36 changed files with 365 additions and 324 deletions

View File

@@ -0,0 +1,50 @@
<?php
use Carbon\Carbon;
use LaravelBook\Ardent\Ardent as Ardent;
/**
* Class PiggybankRepetition
*/
class PiggybankRepetition extends Ardent
{
public static $rules
= [
'piggybank_id' => 'required|exists:piggybanks,id',
'targetdate' => 'date',
'startdate' => 'date',
'currentamount' => 'required|numeric'
];
/**
* @return array
*/
public static function factory()
{
$date = new Carbon;
return [
'piggybank_id' => 'factory|Piggybank',
'targetdate' => $date,
'startdate' => $date,
'currentamount' => 200
];
}
/**
* @return array
*/
public function getDates()
{
return ['created_at', 'updated_at', 'targetdate', 'startdate'];
}
/**
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function piggybank()
{
return $this->belongsTo('Piggybank');
}
}