captainhook
captainhook copied to clipboard
Can't run "php artisan config:cache" because of Closure in config file
After I try to run "php artisan config:cache" I get an error that prevents Laravel from running completely (ReflectionException). After some debugging I found that the problem was in this part of the config file of CaptainHook
'filter' => function($webhook) {
return $webhook->tenant_id == Auth::user()->currentTeam->id;
},
The problem is that Laravel can't cache Closures, so it's throwing an error.
It would be really nice if we could pass to the filter params also a string with the Class and method to be run ("\App\SomeClass@someMethod"), just like you do for the "transformer" and the "response_callback" field.
Do you think it would be possible to make?
and thanks a lot for the amazing libraries you've built!!!
DId you solve the issue?
Unfortunately no. I had to keep it as a Closure and not run config:cache