Answer the question
In order to leave comments, you need to log in
How to use standard Laravel 5.3 events?
Modifying my previous question a bit : Need to track user login (authorization) events in Laravel 5.3. I already know that there is and you can use the standard 'auth.login' login event, and write a handler for this event - as I understand it, the Listener.
I do it as follows:
1) In app/Providers/EventServiceProvider.php I add
protected $listen = [ 'auth.login' => ['App\Listeners\UserEventListener']];
public function handle()
{
Log::info("Пользователь вошел!");
}
protected $listen = [ 'App\Events\UserVisitedEvent' => ['App\Listeners\UserEventListener']];
Event::fire(new UserVisitedEvent());
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question