Store booleans correctly.

This commit is contained in:
James Cole
2018-12-21 15:42:57 +01:00
parent 922c8703f5
commit a5520d45e7
6 changed files with 20 additions and 6 deletions

View File

@@ -51,6 +51,11 @@ class BillRequest extends Request
*/
public function getAll(): array
{
$active = true;
if(null !== $this->get('active')) {
$active = $this->boolean('active');
}
$data = [
'name' => $this->string('name'),
'amount_min' => $this->string('amount_min'),
@@ -60,8 +65,7 @@ class BillRequest extends Request
'date' => $this->date('date'),
'repeat_freq' => $this->string('repeat_freq'),
'skip' => $this->integer('skip'),
'automatch' => $this->boolean('automatch'),
'active' => $this->boolean('active'),
'active' => $active,
'notes' => $this->string('notes'),
];