Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't run "php artisan config:cache" because of Closure in config file #45

Open
crash13override opened this issue May 20, 2017 · 2 comments

Comments

@crash13override
Copy link

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!!!

@legreco
Copy link

legreco commented Oct 30, 2017

DId you solve the issue?

@crash13override
Copy link
Author

Unfortunately no. I had to keep it as a Closure and not run config:cache

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants