protected  function response($message, $code = 200, $itemID = null, $redirectToView = '', $redirectUrl = '', $returnInputErrors = false, $errorsList = [], $noty = [])
    {
        // if we have input errors in the validator
        if($returnInputErrors) {
            return response()->json(
                array(
                    'code' =>           400,
                    'id'                => $itemID,
                    'errors'            => $errorsList,
                    'message'           => $message,
                    'redirectToView'    => $redirectToView,
                    'plugins'           => [],
                    'noty'              => $noty
                )
            );
        }
        // if there are no validation errors return normal errors or no errors if there are non
        return  [
            'code'          => $code,
            'id'            => $itemID,
            'errors'        => $errorsList,
            'message'       => $message,
            'redirectToView'=> $redirectToView,
            'redirectUrl'   => $redirectUrl,
            'plugins'       => [],
            'noty'          => $noty
        ];
    }