Skip to content

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

@crash13override

Description

@crash13override

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions