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

TelescopeServiceProvider not registered in config/app.php #500

Closed
mixmav opened this issue Dec 13, 2018 · 9 comments
Closed

TelescopeServiceProvider not registered in config/app.php #500

mixmav opened this issue Dec 13, 2018 · 9 comments

Comments

@mixmav
Copy link

mixmav commented Dec 13, 2018

Using Laravel 5.7.17.

On a fresh install, when I run composer require laravel/telescope, followed by php artisan telescope:install, I don't see the TelescopeServiceProvider provider registered in my app.php file. After migrating the database, the /telescope route works just fine, though I'm unable to figure out why it doesn't register itself in the config file, because the documentation states that it should.

OS: Windows 10
capture

@themsaid
Copy link
Member

Look closer. If it's working then it's registered.

@mixmav
Copy link
Author

mixmav commented Dec 13, 2018

I installed it on a fresh Laravel install just now, and confirmed that it was working. Here's my app.php file.

https://pastebin.com/dpwNkBv5

Like I said, it's not registered.

@mixmav
Copy link
Author

mixmav commented Dec 13, 2018

I even posted a question on Stack overflow here

@mixmav
Copy link
Author

mixmav commented Dec 13, 2018

@themsaid with all due respect, just because others are unable to reproduce the bug, doesn't mean it doesn't exist. I'm willing to troubleshoot with you.

@themsaid
Copy link
Member

When you run telescope:install do you see a TelescopeServiceProvider in your app/providers folder?

@mixmav
Copy link
Author

mixmav commented Dec 13, 2018

Yes, the TelescopeServiceProvider is there.

@themsaid
Copy link
Member

In Laravel\Telescope\Console\InstallCommand inside the registerTelescopeServiceProvider these lines are what supposed to register the provider to your config file:

        file_put_contents(config_path('app.php'), str_replace(
            "{$namespace}\\Providers\EventServiceProvider::class,".PHP_EOL,
            "{$namespace}\\Providers\EventServiceProvider::class,".PHP_EOL."        {$namespace}\Providers\TelescopeServiceProvider::class,".PHP_EOL,
            $appConfig
        ));

you can start from there to understand what's going on.

@mixmav
Copy link
Author

mixmav commented Dec 13, 2018

I tried running it in tinker, but $namespace wasn't defined.

PHP Notice: Undefined variable: namespace in Psy Shell code on line 1.

Any other suggestions?

@themsaid
Copy link
Member

$namespace is defined at the beginning of the method.

Please try laracasts.com forum for help.

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