OFFLINE-GmbH / oc-clockwork-plugin

Debugging and profiling plugin for October CMS
MIT License
5 stars 2 forks source link

`Application::share()` causes error #4

Open rowild opened 5 years ago

rowild commented 5 years ago

Call to undefined method October\Rain\Foundation\Application::share() /path/to/octobercms/plugins/qub/clockwork/vendor/itsgoingd/clockwork/Clockwork/Support/Laravel/ClockworkServiceProvider.php line 114

I am new to Laravel, OctoverCMS and this plugin. However, after some research on this topic it seems that Application::share() was deprecated. Line 114

$this->app['command.clockwork.clean'] = $this->app->share( function($app){

should bviousely be rewritten as

$this->app['command.clockwork.clean'] = $this->app->singleton('command.clockwork.clean', function ($app){

Unfortunately the error remains, even after clearing the cache manually.

php artisan cache:clear causes his error:

 [Symfony\Component\Debug\Exception\FatalThrowableError]                                                                                                                                                     
  Type error: Argument 2 passed to Clockwork\DataSource\EloquentDataSource::__construct() must be an instance of Illuminate\Events\Dispatcher, instance of October\Rain\Events\Dispatcher given, called in /path/to/october/plugins/qub/clockwork/vendor/itsgoingd/clockwork/Clockwork/Support/Laravel/ClockworkServiceProvider.php on line 63 

I don't know, what is going on here - sorry.