Skip to content

Argument 1 passed to ServiceProvider::registerCollections() must be of the type array, null given #26

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

Open
randhipp opened this issue Mar 2, 2020 · 0 comments

Comments

@randhipp
Copy link

randhipp commented Mar 2, 2020

Hi, im on Laravel Framework 6.17.1 run into this :

Symfony\Component\Debug\Exception\FatalThrowableError : Argument 1 passed to Lanin\Laravel\ApiDebugger\ServiceProvider::registerCollections() must be of the type array, null given, called in E:\laragon-x86\www\w4c\vendor\lanin\laravel-api-debugger\src\ServiceProvider.php on line 26

any clue why this happen?
one can temporary fix by copy paste array from config to this ServiceProvider.php :

public function boot()
    {
        $configPath = __DIR__ . '/../config/api-debugger.php';
        $this->publishes([$configPath => config_path('api-debugger.php')]);
        $this->mergeConfigFrom($configPath, 'api-debugger');

        // Register collections only for debug environment.
        $config = $this->app['config'];
        if ($config['app.debug']) {
            $this->registerCollections([
                // Database queries.
                \Lanin\Laravel\ApiDebugger\Collections\QueriesCollection::class,

                // Show cache events.
                \Lanin\Laravel\ApiDebugger\Collections\CacheCollection::class,

                // Profile custom events.
                \Lanin\Laravel\ApiDebugger\Collections\ProfilingCollection::class,
            ]);
        }
    }
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

1 participant