Closed m4tthumphrey closed 10 years ago
Looks like you just need to move blockAccess()
to the Firewall
class and make it public and change line line 33 of Blacklist.php to $firewall->blockAccess();
Not sure how this hasn't been spotted before...
Yeah, it was not published because this is something the package does automatically for you, but I understand sometimes you might need to do that manually, so I just pushed "fix".
I don't understand? What do you mean the package does it automatically?
Yes. You just have to use the artisan commands:
php artisan firewall:blacklist 200.201.202.1
And it will say:
200.201.202.1 is now blacklisted
Then if someone at that IP try to access your application it will be automatically blocked.
Problem still exists.
Call to undefined method PragmaRX\Firewall\Filters\Blacklist::blockAccess()
if ($firewall->isBlacklisted())
{
$firewall->log('[blocked] IP blacklisted: '.$firewall->getIp());
return $this->blockAccess();
}
Using "pragmarx/firewall" : "dev-master"
with "minimum-stability": "stable"
.
It's now fixed, and it was odd. Thank you.
Have just installed into my Laravel 4.1 project and get the following error:
Call to undefined method PragmaRX\Firewall\Firewall::blockAccess()
Your service provider returns an instance of
Firewall
for thefirewall
service and that class doesn't have ablockAccess
method, but the service provider does.All very odd...