src/Filters/UrlFilter.php
public function filter($value, array $options = [])
    {
        if ( ! is_string($value)) return $value;

        $value = trim($value);

        if ( ! Str::startsWith($value, ['http://', 'https://'])) {
            $value = "http://$value";
        }

        return filter_var($value, FILTER_SANITIZE_URL);
    }
public function filter($value, array $options = [])
    {
        if ( ! is_string($value)) return $value;

        $value = trim($value);

        if ( ! Str::startsWith($value, ['http://', 'https://'])) {
            $value = "http://$value";
        }

        return filter_var($value, FILTER_SANITIZE_URL);
    }
public function filter ( $ value , array $ options = [ ] ) { if ( ! is_string ( $ value ) ) return $ value ; $ value = trim ( $ value ) ; if ( ! Str :: startsWith ( $ value , [ 'http://' , 'https://' ] ) ) { $ value = "http://$value" ; } return filter_var ( $ value , FILTER_SANITIZE_URL ) ; }
Sanitize url of the given string.

@param  mixed  $value
@param  array  $options

@return string|mixed
Sanitize url of the given string .