PHP code example of digitalcorehub / laravel-ip-restriction
1. Go to this page and download the library: Download digitalcorehub/laravel-ip-restriction 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/ */
digitalcorehub / laravel-ip-restriction example snippets
return [
'allowed_ips' => [
"127.0.0.1", // Localhost
// Other IPs
],
];
Route::middleware(['restrict_to_ip'])->group(function () {
Route::get('/admin', function () {
return view('admin.dashboard');
});
});
bash
php artisan vendor:publish --tag=ip-restriction-config