PHPackages                             mdooley47/laravel-urlvalidator - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Validation &amp; Sanitization](/categories/validation)
4. /
5. mdooley47/laravel-urlvalidator

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

mdooley47/laravel-urlvalidator
==============================

Adds additional url validation

v1.2.1(7y ago)0391MITPHPCI failing

Since Sep 1Pushed 7y ago1 watchersCompare

[ Source](https://github.com/MDooley47/laravel-urlvalidator)[ Packagist](https://packagist.org/packages/mdooley47/laravel-urlvalidator)[ RSS](/packages/mdooley47-laravel-urlvalidator/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (1)Versions (7)Used By (1)

laravel-urlvalidator
====================

[](#laravel-urlvalidator)

Install
-------

[](#install)

You can install the package with composer:

```
composer require mdooley47/laravel-urlvalidator
```

How to Use
----------

[](#how-to-use)

Adds more robust ways to validate URLs.

You can use the `\MDooley47\UrlValidator\UrlValidator::match` method to validate urls like so:

```
\MDooley47\UrlValidator\UrlValidator::match(
    'https://user:pass@sub.domain.tld/path?query=true#fragment',
    [
        'scheme' => 'https',
        'user' => 'user',
        'pass' => 'pass',
        'subdomain' => 'sub',
        'domain' => 'domain',
        'tld' => 'tld',
        'path' => '/path',
        'query' => 'query=true',
        'fragment' => 'fragment',
        'host' => 'sub.domain.tld',
    ]);
// Returns Validator->passes()

// You can pass a string in place of the $options array.
// This will default to using the host validator.
// Since we use Str::is, that means we can match a pattern.
\MDooley47\UrlValidator\UrlValidator::match(
    'https://user:pass@sub.domain.tld/path?query=true#fragment',
    'sub.*.tld'
    );
```

Or you can use it in a normal Validator like so

```
\Illuminate\Support\Facades\Validator::make(
    [
        'url' => 'https://user:pass@sub.domain.tld/path?query=true#fragment'
    ],
    [
        'url' => 'required|url|scheme:https|user:user|pass:pass|subdomain:sub|domain:domain|tld:tld|path:/path|query:query=true|fragment:fragment|host:sub.domain.tld',
    ]
);
```

How it Works
------------

[](#how-it-works)

Because we use Str::is we have powerful matching options such as using an asterisks (\*) as a wild card. As a result of using Str::is, for subdomain matching we use the pattern: `${value}.*`, for domain matching we use `*.${value}.*` and for tld matching we use `*.${value}`. The `$value` variable the the pattern you pass in.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

6

Last Release

2806d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4d099c61c3ba07e16c61a0c278c9536615863c954b01d9efbddcc7a77a4d299a?d=identicon)[MDooley47](/maintainers/MDooley47)

---

Top Contributors

[![marzvrover](https://avatars.githubusercontent.com/u/6617862?v=4)](https://github.com/marzvrover "marzvrover (15 commits)")

---

Tags

laravellaravel-5-packageurlurl-validationvalidationurllaravelvalidateurl validation

### Embed Badge

![Health badge](/badges/mdooley47-laravel-urlvalidator/health.svg)

```
[![Health](https://phpackages.com/badges/mdooley47-laravel-urlvalidator/health.svg)](https://phpackages.com/packages/mdooley47-laravel-urlvalidator)
```

###  Alternatives

[proengsoft/laravel-jsvalidation

Validate forms transparently with Javascript reusing your Laravel Validation Rules, Messages, and FormRequest

1.1k2.3M49](/packages/proengsoft-laravel-jsvalidation)[stevebauman/purify

An HTML Purifier / Sanitizer for Laravel

5325.6M19](/packages/stevebauman-purify)[axlon/laravel-postal-code-validation

Worldwide postal code validation for Laravel and Lumen

3853.3M1](/packages/axlon-laravel-postal-code-validation)[laravel-validation-rules/credit-card

Validate credit card number, expiration date, cvc

2412.2M5](/packages/laravel-validation-rules-credit-card)[sadegh19b/laravel-persian-validation

A comprehensive Laravel validation package for Persian text, numbers, dates, and Iranian national identifiers

18293.8k1](/packages/sadegh19b-laravel-persian-validation)[illuminatech/validation-composite

Allows uniting several validation rules into a single one for easy re-usage

184485.5k](/packages/illuminatech-validation-composite)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
