PHP code example of avcodewizard / block-by-country
1. Go to this page and download the library: Download avcodewizard/block-by-country 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/ */
avcodewizard / block-by-country example snippets
return [
'blocked_countries' => ['CN', 'RU', 'IR'], // Add country codes to block here.
];
Route::get('/dashboard', function () {
return view('dashboard');
})->middleware('block.country');
Route::group(['middleware' => 'block.country'], function () {
Route::get('/dashboard', function () {
return view('dashboard');
});
// put all your routes inside this group ...
});