src/Components/Validation/Validation.php
public function sanitize($data)
    {
        if (! is_array($data)) {
            return filter_var(trim($data), FILTER_SANITIZE_STRING);
        }

        foreach ($data as $key => $value) {
            $data[$key] = filter_var($value, FILTER_SANITIZE_STRING);
        }
        return $data;
    }
public function sanitize($data)
    {
        if (! is_array($data)) {
            return filter_var(trim($data), FILTER_SANITIZE_STRING);
        }

        foreach ($data as $key => $value) {
            $data[$key] = filter_var($value, FILTER_SANITIZE_STRING);
        }
        return $data;
    }
Sanitizing Data

@param string $data

@return string