You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Lumen 7.x, the Event Listeners in LumenEventServiceProvider are not properly registered and thus not called on delete.
The boot() Method in Providers/LumenEventServiceProvider is never called by the framework and thus the event listeners are not properly registered.
Steps To Reproduce:
Set up laravel-soft-cascade in a fresh lumen 7.x project
create models and add SoftCascadeTrait, $softCascade and relations
delete parent model
children are not soft-deleted
How to Fix:
In Providers/LumenServiceProvider: simply moving $this->app->register(LumenEventServiceProvider::class); from boot() to register():
// src\Providers\LumenServiceProvider.php
<?php
namespace Askedio\SoftCascade\Providers;
use Illuminate\Support\ServiceProvider;
class LumenServiceProvider extends ServiceProvider
{
/**
* Register the service provider.
*
* @return void
*/
public function register()
{
$this->app->register(LumenEventServiceProvider::class); // move this here
}
/**
* Register routes, translations, views and publishers.
*
* @return void
*/
public function boot()
{
//
}
}
The text was updated successfully, but these errors were encountered:
Description:
In Lumen 7.x, the Event Listeners in LumenEventServiceProvider are not properly registered and thus not called on delete.
The
boot()
Method in Providers/LumenEventServiceProvider is never called by the framework and thus the event listeners are not properly registered.Steps To Reproduce:
How to Fix:
In Providers/LumenServiceProvider: simply moving
$this->app->register(LumenEventServiceProvider::class);
fromboot()
toregister()
:The text was updated successfully, but these errors were encountered: