1
0
mirror of https://github.com/freescout-helpdesk/freescout.git synced 2024-11-25 11:52:29 +01:00
freescout/app/Listeners/LogUserDeletion.php
2018-09-19 01:00:59 -07:00

35 lines
669 B
PHP

<?php
namespace App\Listeners;
use App\Events\UserDeleted;
class LogUserDeletion
{
/**
* Create the event listener.
*
* @return void
*/
public function __construct()
{
//
}
/**
* Handle the event.
*
* @param Login $event
*
* @return void
*/
public function handle(UserDeleted $event)
{
activity()
->causedBy($event->user)
->withProperties(['deleted_user' => $event->deleted_user->getFullName().' ['.$event->deleted_user->id.']'])
->useLog(\App\ActivityLog::NAME_USER)
->log(\App\ActivityLog::DESCRIPTION_USER_DELETED);
}
}