SGouws SGouws - 3 months ago 45
PHP Question

Clarity on the use of pragmarx/firewall package for Laravel 5.2

so I've just completed the install of antonioribeiro/firewall package for laravel, which essentially allows blacklisting and whitelist of IP address and countries.

I'm working through the section on Artisan Commands, but when i try to run 'php artisan firewall:whitelist country:za' I get the following error:

[Symfony\Component\Console\Exception\CommandNotFoundException]
Command "firewall:whitelist" is not defined.
Did you mean one of these?
firewall:list
firewall:tables


I have done all the necessary installation steps outlined in the documentation.

What am i doing wrong ? should I be using this command elsewhere ?
I am aware that these can be manually entered into the DB, but this functionality would be great to have.

Answer

I managed to fix the problem:

SOLUTION: When you run 'php artisan vendor:publish' it creates a new file called 'firewall.php' in the config directory. This is where you set default options. Simply change 'use_database' to true and the Database specific commands will work.

firewall:blacklist
firewall:clear
firewall:remove
firewall:whitelist