mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-29 18:20:01 +00:00
Clean up code.
This commit is contained in:
@@ -3,6 +3,7 @@ declare(strict_types = 1);
|
||||
namespace FireflyIII\Http\Requests;
|
||||
|
||||
use Auth;
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Models\Tag;
|
||||
use Input;
|
||||
|
||||
@@ -46,4 +47,34 @@ class TagFormRequest extends Request
|
||||
'tagMode' => 'required|in:nothing,balancingAct,advancePayment',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function collectTagData() :array
|
||||
{
|
||||
if (Input::get('setTag') == 'true') {
|
||||
$latitude = $this->get('latitude');
|
||||
$longitude = $this->get('longitude');
|
||||
$zoomLevel = $this->get('zoomLevel');
|
||||
} else {
|
||||
$latitude = null;
|
||||
$longitude = null;
|
||||
$zoomLevel = null;
|
||||
}
|
||||
$date = $this->get('date') ?? '';
|
||||
|
||||
$data = [
|
||||
'tag' => $this->get('tag'),
|
||||
'date' => strlen($date) > 0 ? new Carbon($date) : null,
|
||||
'description' => $this->get('description') ?? '',
|
||||
'latitude' => $latitude,
|
||||
'longitude' => $longitude,
|
||||
'zoomLevel' => $zoomLevel,
|
||||
'tagMode' => $this->get('tagMode'),
|
||||
];
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user