PHP code example of soumairi / domain-checker

1. Go to this page and download the library: Download soumairi/domain-checker library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

soumairi / domain-checker example snippets


//app/Http/Kernel.php

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

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'
];

//config/domain-checker.php
'allowed_domains' => [
        'localhost',
        '127.0.0.1',
        '...'
    ],
bash
php artisan vendor:publish --provider="Soumairi\DomainChecker\DomainCheckerServiceProvider"