PHP code example of byteflick / laravel-strict-domain

1. Go to this page and download the library: Download byteflick/laravel-strict-domain 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/ */

    

byteflick / laravel-strict-domain example snippets


return [
    '=> env('APP_DOMAIN', 'localhost.com'),
];

APP_DOMAIN=localhost.com

->withMiddleware(function (Middleware $middleware) {
     $middleware->append(\ByteFlick\LaravelStrictDomain\Middlewares\RedirectExternalTraffic::class);
})

protected $middleware = [
    \ByteFlick\LaravelStrictDomain\Middlewares\RedirectExternalTraffic::class,
];

->withMiddleware(function (Middleware $middleware) {
     $middleware->append(\ByteFlick\LaravelStrictDomain\Middlewares\BlockExternalTraffic::class);
})

protected $middleware = [
    \ByteFlick\LaravelStrictDomain\Middlewares\BlockExternalTraffic::class,
];
bash
php artisan vendor:publish --provider="ByteFlick\LaravelStrictDomain\LaravelStrictDomainServiceProvider"