Skip to content
Johnny Mast edited this page May 31, 2020 · 5 revisions

In App\Providers\EventServiceProvider and update the $listen array with:

    protected $listen = [
        // --
        \Redbox\Tracker\Events\NewVisitorEvent::class => [
            \App\Listeners\NewVisitorListener::class,
        ]
        // --
    ];

In App\Listeners\NewvisitorListener you now have access to the visitor data from $event->visitor.

    /**
     * Handle the event.
     *
     * @param  object  $event
     * @return void
     */
    public function handle($event)
    {
        dd($event->visitor);
    }
Clone this wiki locally