gerardojbaez / laraplans

SaaS style recurring plans for Laravel.
http://laraplans.readthedocs.io
MIT License
180 stars 81 forks source link

undefined method Illuminate\Events\Dispatcher::fire() #48

Closed alexcagliari87 closed 4 years ago

alexcagliari87 commented 5 years ago

Hi, when i try this code:

$user = Auth::user();

$plan = Plan::where('name','Test')->first();

$user->newSubscription('lorem ipsum', $plan)->create();

i get an exception:

Call to undefined method Illuminate\Events\Dispatcher::fire() {"userId":1,"exception":"[object] (Symfony\Component\Debug\Exception\FatalThrowableError(code: 0): Call to undefined method Illuminate\Events\Dispatcher::fire() at /var/www/html/xxx/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php:237) ...........

What can we do to solve this problem? Is fire a deprecated method? I'm using laravel 5.8. Thanks

Yahav commented 5 years ago

The 'fire' Method The fire method (which was deprecated in Laravel 5.4) of the Illuminate/Events/Dispatcher class has been removed. You should use the dispatch method instead.

rifan75 commented 5 years ago

just change file src\Laraplans\Models\PlanSubscription.php line 87, Event::fire to Event:dispatch. I already aplly pull request about this issue

siarheipashkevich commented 5 years ago

Any updates?

samtoya commented 5 years ago

Any updates on this please? I need to deploy my application to production and it relies on this package.

Thanks guys.

siarheipashkevich commented 4 years ago

@gerardojbaez any updates?

gerardojbaez commented 4 years ago

I've just released v3.0.0 which addresses this issue, along with support for L5.8. Feel free to open a new issue should anyone have any issues.