protected function error($errors = null, string $message = '')
    {

        if(!$errors) {
            $errors = ['Your request has not been validated by the system. Please check your request URL and parameters!'];
        }

        // make it array
        else if(!is_array($errors)) {
            $errors = [$errors];
        }

        return response()->json(['errors' => $errors], 400);
    }
protected function error($errors = null, string $message = '')
    {

        if(!$errors) {
            $errors = ['Your request has not been validated by the system. Please check your request URL and parameters!'];
        }

        // make it array
        else if(!is_array($errors)) {
            $errors = [$errors];
        }

        return response()->json(['errors' => $errors], 400);
    }
protected function error ( $ errors = null , string $ message = '' ) { if ( ! $ errors ) { $ errors = [ 'Your request has not been validated by the system. Please check your request URL and parameters!' ] ; } // make it array else if ( ! is_array ( $ errors ) ) { $ errors = [ $ errors ] ; } return response ( ) -> json ( [ 'errors' => $ errors ] , 400 ) ; }
Setup error response.

@param  mixed  $errors
@param  string $message
@return \Illuminate\Http\JsonResponse
Setup error response .