Skip to content

Clockwork on Lumen: Call to undefined method Laravel\Lumen\Application::configPath() #354

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

Closed
codeclem opened this issue Sep 27, 2019 · 3 comments

Comments

@codeclem
Copy link

codeclem commented Sep 27, 2019

I just installed the latest Clockwork 4.0.10 on a fresh Lumen app. I registered the service provider in bootstrap/app.php:

if ($app->environment('local')) { $app->register(Laravel\Tinker\TinkerServiceProvider::class); $app->register(Clockwork\Support\Laravel\ClockworkServiceProvider::class); }

Then when I run php artisan vendor:publish I get this error
`PHP Fatal error: Uncaught Symfony\Component\Debug\Exception\FatalThrowableError: Call to undefined method Laravel\Lumen\Application::configPath() in /home/user/projects/lumen-app/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php:296
Stack trace:
#0 /home/user/projects/lumen-app/vendor/itsgoingd/clockwork/Clockwork/Support/Laravel/ClockworkServiceProvider.php(61): config_path('clockwork.php')
#1 /home/user/projects/lumen-app/vendor/laravel/lumen-framework/src/Application.php(200): Clockwork\Support\Laravel\ClockworkServiceProvider->register()
#2 /home/user/projects/lumen-app/bootstrap/app.php(87): Laravel\Lumen\Application->register(Object(Clockwork\Support\Laravel\ClockworkServiceProvider))
#3 /home/user/projects/lumen-app/artisan(18): require('/home/user/proj...')
#4 {main}
thrown in /home/user/projects/lumen-app/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php on line 296

In helpers.php line 296:

Uncaught Symfony\Component\Debug\Exception\FatalThrowableError: Call to undefined m
ethod Laravel\Lumen\Application::configPath() in /home/user/projects/magnet-directo
ry/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php:296
Stack trace:
#0 /home/user/projects/lumen-app/vendor/itsgoingd/clockwork/Clockwork/Suppor
t/Laravel/ClockworkServiceProvider.php(61): config_path('clockwork.php')
#1 /home/user/projects/lumen-app/vendor/laravel/lumen-framework/src/Applicat
ion.php(200): Clockwork\Support\Laravel\ClockworkServiceProvider->register()
#2 /home/user/projects/lumen-app/bootstrap/app.php(87): Laravel\Lumen\Applic
ation->register(Object(Clockwork\Support\Laravel\ClockworkServiceProvider))
#3 /home/user/projects/lumen-app/artisan(18): require('/home/user/proj...')
#4 {main}
thrown`

Edit: After removing Clockwork and trying to get back to work on my app I had the issue described here laravel/lumen-framework#504 It seems related. I had to nuke composer's cache and the vendor directory to get things working again. See the comment by lsl about half way down that page.

@itsgoingd
Copy link
Owner

Hey, looks like you've registered the Laravel service provider instead of the Lumen one.

@codeclem
Copy link
Author

codeclem commented Sep 29, 2019

Oh jeez. Thank you.

So that fixed that problem, but I still can't get it to work right. First I got a bunch of 404s on the web frontend assets, so I just manually copied vendor/itsgoingd/clockwork/Clockwork/Web/public/* to public/__clockwork. Now the interface shows up but it's not responding to any requests I send to the server. Could you share with me the correct steps to setup Clockwork with a Lumen json API? Thank you so much.

@itsgoingd
Copy link
Owner

Are you using the built-in php server? It doesn't process urls with dots (like out web assets) correctly. I'd suggest using a proper web server, though copying the assets should also work.

Can you see any errors or network requests in Dev Tools when you open up the web interface?

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