PHP code example of taavi / laravel-torblock
1. Go to this page and download the library: Download taavi/laravel-torblock 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/ */
taavi / laravel-torblock example snippets
class Kernel extends HttpKernel
{
protected $routeMiddleware = [
'torblock' => \Taavi\LaravelTorblock\Middleware\BlockTorAccess::class,
];
}
namespace Tests;
use Taavi\LaravelTorblock\Service\FakeTorExitNodeService;
use Taavi\LaravelTorblock\Service\TorExitNodeService;
use Illuminate\Foundation\Testing\TestCase as BaseTestCase;
abstract class TestCase extends BaseTestCase
{
use CreatesApplication;
protected function setUp(): void
{
parent::setUp();
$this->app->bind(TorExitNodeService::class, FakeTorExitNodeService::class);
}
}