src/Http/Request.php
protected function filter(array $input, string $var, $filter = null)
    {
        $value = $input[$var] ?? false;

        if (!$filter) {
            return $value;
        }

        return filter_var($value, $filter);
    }
protected function filter(array $input, string $var, $filter = null)
    {
        $value = $input[$var] ?? false;

        if (!$filter) {
            return $value;
        }

        return filter_var($value, $filter);
    }
A util function to filter values via filter_var().

@param array  $input
@param string $var
@param [type] $filter