github hhxsv5/laravel-s v3.7.33
Refactor customized async event listener

latest releases: v3.8.0, v3.7.38, v3.7.37...
2 years ago
  • Remove method:Listener::__construct(Event $event).
  • Change method:Listener::handle() to Listener::handle(Event $event).
  • Return false to stop propagating the event to subsequent listeners in Listener::handle().

Before:

abstract class Listener
{
    protected $event;

    public function __construct(Event $event)
    {
        $this->event = $event;
    }

    /**
     * The logic of handling event
     * @return void
     */
    abstract public function handle();
}

Now:

abstract class Listener
{
    /**
     * The logic of handling event
     * @param Event $event
     * @return mixed
     */
    abstract public function handle(Event $event);
}

Don't miss a new laravel-s release

NewReleases is sending notifications on new releases.