status = $httpStatusCode; } public function authorize() { return true; } public function messages() { return [ 'amount.between' => 'Invalid top up amount' ]; } /** * Get the validation rules that apply to the request. * * @return array */ public function rules(Request $request) { switch($this->method()) { case 'POST': $rules = [ 'amount' => 'required|numeric|between:100,10000', ]; return $rules; break; default: } } public function response(array $errors) { return $this->status->mobile_error(isset($errors['amount'][0]) ? $errors['amount'][0] : 'Form Validation Error'); } } ?>