From 706b095f95fb5acc27adf140cc232d5db57595cb Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 12 Feb 2016 17:50:12 +0100 Subject: [PATCH] Forgot to actually return the created array. --- app/Http/Requests/TagFormRequest.php | 49 ++++++++++++++-------------- 1 file changed, 25 insertions(+), 24 deletions(-) diff --git a/app/Http/Requests/TagFormRequest.php b/app/Http/Requests/TagFormRequest.php index fb88f91c85..531770b38f 100644 --- a/app/Http/Requests/TagFormRequest.php +++ b/app/Http/Requests/TagFormRequest.php @@ -24,30 +24,6 @@ class TagFormRequest extends Request return Auth::check(); } - /** - * @return array - */ - public function rules() - { - $idRule = ''; - $tagRule = 'required|min:1|uniqueObjectForUser:tags,tag'; - if (Tag::find(Input::get('id'))) { - $idRule = 'belongsToUser:tags'; - $tagRule = 'required|min:1|uniqueObjectForUser:tags,tag,' . Input::get('id'); - } - - return [ - 'tag' => $tagRule, - 'id' => $idRule, - 'description' => 'min:1', - 'date' => 'date', - 'latitude' => 'numeric|min:-90|max:90', - 'longitude' => 'numeric|min:-90|max:90', - 'zoomLevel' => 'numeric|min:0|max:80', - 'tagMode' => 'required|in:nothing,balancingAct,advancePayment', - ]; - } - /** * @return array */ @@ -74,7 +50,32 @@ class TagFormRequest extends Request 'tagMode' => $this->get('tagMode'), ]; + return $data; } + + /** + * @return array + */ + public function rules() + { + $idRule = ''; + $tagRule = 'required|min:1|uniqueObjectForUser:tags,tag'; + if (Tag::find(Input::get('id'))) { + $idRule = 'belongsToUser:tags'; + $tagRule = 'required|min:1|uniqueObjectForUser:tags,tag,' . Input::get('id'); + } + + return [ + 'tag' => $tagRule, + 'id' => $idRule, + 'description' => 'min:1', + 'date' => 'date', + 'latitude' => 'numeric|min:-90|max:90', + 'longitude' => 'numeric|min:-90|max:90', + 'zoomLevel' => 'numeric|min:0|max:80', + 'tagMode' => 'required|in:nothing,balancingAct,advancePayment', + ]; + } }