PHPackages                             soumairi/domain-checker - 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. [Framework](/categories/framework)
4. /
5. soumairi/domain-checker

ActiveLibrary[Framework](/categories/framework)

soumairi/domain-checker
=======================

domain-checker is a package to check domains for an extra security layer

v1.0.4(4y ago)6204MITPHPPHP ^7.2 | ^7.3 | ^8.0

Since Apr 14Pushed 3y ago1 watchersCompare

[ Source](https://github.com/soumairi/laravel-domain-checker)[ Packagist](https://packagist.org/packages/soumairi/domain-checker)[ RSS](/packages/soumairi-domain-checker/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (1)Versions (8)Used By (0)

Laravel Domain Checker
======================

[](#laravel-domain-checker)

A LARAVEL package to authorize allowed domains
----------------------------------------------

[](#a-laravel-package-to-authorize-allowed-domains)

[![Latest Version on Packagist](https://camo.githubusercontent.com/1bb10fce322ae3cfd3046ee1320c27dba1ef9691e33e11cc1a2bb9a5e999b350/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f736f756d616972692f646f6d61696e2d636865636b65723f7374796c653d666c6174)](https://packagist.org/packages/soumairi/domain-checker)[![Software License](https://camo.githubusercontent.com/0ac9d70c10686e14eba1d853839fbf6339b4c58ccd7d17001299282d77c38599/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f736f756d616972692f6c61726176656c2d646f6d61696e2d636865636b65723f7374796c653d666c6174)](LICENSE)[![Total Downloads](https://camo.githubusercontent.com/2dfdbc5ed2e3eb8684d6fc5defe6613c976a3dc6d7f7d06cf1302ebd8216895c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f736f756d616972692f646f6d61696e2d636865636b65723f7374796c653d666c6174)](https://packagist.org/packages/soumairi/domain-checker)[![Build Status](https://camo.githubusercontent.com/64bc0d38dd2b7f8edb3d186cbb65149ba1795dc8e215c56db331047f75f86074/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f736f756d616972692f6c61726176656c2d646f6d61696e2d636865636b65722f6261646765732f6275696c642e706e673f623d6d61696e)](https://scrutinizer-ci.com/g/soumairi/laravel-domain-checker/build-status/main)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/a2239a435d26aa436daf78489f9e970d7c81802e7a00b12b20a627ea0dfa6b4b/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f736f756d616972692f6c61726176656c2d646f6d61696e2d636865636b65722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d61696e)](https://scrutinizer-ci.com/g/soumairi/laravel-domain-checker/?branch=main)[![Code Intelligence Status](https://camo.githubusercontent.com/102fcadcacd8d46897e0bf024da558e06ea4e9d4b89a2532e61cb5a1ff0db572/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f736f756d616972692f6c61726176656c2d646f6d61696e2d636865636b65722f6261646765732f636f64652d696e74656c6c6967656e63652e7376673f623d6d61696e)](https://scrutinizer-ci.com/code-intelligence)

ABOUT
-----

[](#about)

This package aims to add a security level to the application for checking the allowed domains of all the incoming HTTP requests of the application. This package makes it easy to add a level between the incoming HTTP requests and your application by using middleware.

Install
-------

[](#install)

You can install the package via composer:

```
$ composer require soumairi/domain-checker
```

Next, the `\Soumairi\DomainChecker\Http\Middleware\DomainCheckerMiddleware::class`-middleware must be registered in the kernel:

```
//app/Http/Kernel.php

protected $middleware = [
  ...
  \Soumairi\DomainChecker\Http\Middleware\DomainCheckerMiddleware::class,
];
```

You can publish the config-file with:

```
php artisan vendor:publish --provider="Soumairi\DomainChecker\DomainCheckerServiceProvider"
```

This is the contents of the published config file:

```
return [
    /**
     * Allowed domains of all the incoming HTTP requests to the application to make a call to our application.
     */
    'allowed_domains' => [
        'localhost',
        '127.0.0.1',
    ],

    /**
     * Custom Error Message
     */
    'error_message' => 'This host is not allowed'
];
```

Usage
-----

[](#usage)

To authorize a domain, it must be added in the `allowed_domains` array :

```
//config/domain-checker.php
'allowed_domains' => [
        'localhost',
        '127.0.0.1',
        '...'
    ],
```

by default `localhost` and `127.0.0.1` are allowed.

you can customize error message on the `error_message`.

Credits
-------

[](#credits)

- [Mouhssine Soumairi](https://github.com/soumairi)
- [Hamza Ouhamou](https://github.com/Ouhamou)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 80% 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

5

Last Release

1489d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/59e35ab480341346489b203bfe699e9c94a640c3cb2c9ce2a9dcaf9669bcd34b?d=identicon)[soumairi](/maintainers/soumairi)

![](https://www.gravatar.com/avatar/1d31e784fede5af502e363d670c467e5fcad87aad1c213b02deb080afc6baf2f?d=identicon)[hamza ouhamou](/maintainers/hamza%20ouhamou)

---

Top Contributors

[![mouhssinesoumairi](https://avatars.githubusercontent.com/u/174803871?v=4)](https://github.com/mouhssinesoumairi "mouhssinesoumairi (20 commits)")[![soumairi](https://avatars.githubusercontent.com/u/16350169?v=4)](https://github.com/soumairi "soumairi (3 commits)")[![Ouhamou](https://avatars.githubusercontent.com/u/43830973?v=4)](https://github.com/Ouhamou "Ouhamou (2 commits)")

---

Tags

frameworklaraveldomain-checkerallowed domainssoumairiouhamou

### Embed Badge

![Health badge](/badges/soumairi-domain-checker/health.svg)

```
[![Health](https://phpackages.com/badges/soumairi-domain-checker/health.svg)](https://phpackages.com/packages/soumairi-domain-checker)
```

###  Alternatives

[rebing/graphql-laravel

Laravel wrapper for PHP GraphQL

2.2k7.1M26](/packages/rebing-graphql-laravel)[graham-campbell/markdown

Markdown Is A CommonMark Wrapper For Laravel

1.3k7.1M64](/packages/graham-campbell-markdown)[graham-campbell/manager

Manager Provides Some Manager Functionality For Laravel

39221.1M134](/packages/graham-campbell-manager)[laravel-lang/publisher

Localization publisher for your Laravel application

2167.7M24](/packages/laravel-lang-publisher)[laravel-zero/framework

The Laravel Zero Framework.

3371.4M369](/packages/laravel-zero-framework)[lanin/laravel-api-debugger

Easily debug your JSON API.

2311.8M](/packages/lanin-laravel-api-debugger)

PHPackages © 2026

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