akaunting / laravel-firewall

Web Application Firewall (WAF) package for Laravel
https://akaunting.com
MIT License
942 stars 106 forks source link

Error while discover after installing #27

Closed ninijule closed 4 years ago

ninijule commented 4 years ago

"Writing lock file Generating optimized autoload files

Illuminate\Foundation\ComposerScripts::postAutoloadDump @php artisan package:discover --ansi

TypeError

Argument 2 passed to Illuminate\Routing\Router::middlewareGroup() must be of the type array, null given, called in /home/pi/GestionJ/idf-armatures/vendor/akaunting/firewall/src/Provider.php on line 60

at vendor/laravel/framework/src/Illuminate/Routing/Router.php:879 875| @param string $name 876| @param array $middleware 877| @return $this 878| /

879| public function middlewareGroup($name, array $middleware) 880| { 881| $this->middlewareGroups[$name] = $middleware; 882| 883| return $this;

  +10 vendor frames

11 [internal]:0 Illuminate\Foundation\Application::Illuminate\Foundation{closure}(Object(Akaunting\Firewall\Provider))

  +5 vendor frames

17 artisan:37 Illuminate\Foundation\Console\Kernel::handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1"

This is happens while i was trying to install Do you have a idea what is the problem TY ! ;D

vlasscontreras commented 4 years ago

I think it's because the config file not existing during the installation, thus $router->middlewareGroup() receives a null here:

https://github.com/akaunting/firewall/blob/102a77045789d773572f2efb04341c81e05c0c9f/src/Provider.php#L60

I managed to install it by manually copying the config file located at akaunting/firewall/blob/master/src/Config/firewall.php and then php artisan config:cache, then proceeding normally with the installation.

vlasscontreras commented 4 years ago

I have issued #31 to fix this.

denisdulici commented 4 years ago

Feel free to follow the PR.