1
0
mirror of https://github.com/freescout-helpdesk/freescout.git synced 2024-11-26 04:12:31 +01:00
freescout/app/Listeners/ActivateUser.php

36 lines
628 B
PHP
Raw Normal View History

2018-09-02 08:45:13 +02:00
<?php
namespace App\Listeners;
use App\User;
use Illuminate\Auth\Events\Login;
class ActivateUser
{
/**
* Create the event listener.
*
* @return void
*/
public function __construct()
{
//
}
/**
* Handle the event.
*
* @param Login $event
*
* @return void
*/
public function handle(Login $event)
{
if ($event->user->invite_state != User::INVITE_STATE_ACTIVATED) {
$event->user->invite_state = User::INVITE_STATE_ACTIVATED;
$event->user->invite_hash = '';
$event->user->save();
}
}
}