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

wrap service provider boot code in telescope.enabled conditional #670

Merged
merged 2 commits into from
Jul 26, 2019
Merged

wrap service provider boot code in telescope.enabled conditional #670

merged 2 commits into from
Jul 26, 2019

Conversation

mattquest
Copy link
Contributor

Currently, disabling telescope through the TELESCOPE_ENABLED environment variable will prevent Telescope::start from running but does not prevent telescope from registering routes, migrations, views etc. in the TelescopeServiceProvider->boot method.

This can cause unexpected errors and problems in situations like a testing environment where telescope is disabled and the migrations are not expected to be registered.

@taylorotwell taylorotwell merged commit eb5a164 into laravel:2.0 Jul 26, 2019
@Namoshek
Copy link
Contributor

This PR actually broke some Dusk tests of mine because the Telescope route of a link in the menu was not registered.

Disabling a package entirely seems very drastic to me. I would suggest reverting this and letting affected users registering the TelescopeServiceProvider only in non-testing environments:

// in AppServiceProvider::register()
if ($this->app->environment('testing') === false) {
    $this->app->register(\Laravel\Telescope\TelescopeServiceProvider::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

Successfully merging this pull request may close these issues.

3 participants