Cleaned up some double code.

This commit is contained in:
James Cole
2015-03-29 11:51:26 +02:00
parent 24dd3578ed
commit bcf066ead7
5 changed files with 111 additions and 130 deletions

View File

@@ -3,6 +3,7 @@
namespace FireflyIII\Http\Requests;
use Auth;
use Carbon\Carbon;
use Input;
/**
@@ -21,6 +22,26 @@ class BillFormRequest extends Request
return Auth::check();
}
/**
* @return array
*/
public function getBillData()
{
return [
'name' => $this->get('name'),
'match' => $this->get('match'),
'amount_min' => floatval($this->get('amount_min')),
'amount_currency_id' => floatval($this->get('amount_currency_id')),
'amount_max' => floatval($this->get('amount_max')),
'date' => new Carbon($this->get('date')),
'user' => Auth::user()->id,
'repeat_freq' => $this->get('repeat_freq'),
'skip' => intval($this->get('skip')),
'automatch' => intval($this->get('automatch')) === 1,
'active' => intval($this->get('active')) === 1,
];
}
/**
* @return array
*/