Add event action storage. Closes #2344
This commit is contained in:
@@ -13,9 +13,29 @@ namespace CachetHQ\Cachet\Bus\Handlers\Commands\Incident;
|
||||
|
||||
use CachetHQ\Cachet\Bus\Commands\Incident\RemoveIncidentCommand;
|
||||
use CachetHQ\Cachet\Bus\Events\Incident\IncidentWasRemovedEvent;
|
||||
use Illuminate\Contracts\Auth\Guard;
|
||||
|
||||
class RemoveIncidentCommandHandler
|
||||
{
|
||||
/**
|
||||
* The authentication guard instance.
|
||||
*
|
||||
* @var \Illuminate\Contracts\Auth\Guard
|
||||
*/
|
||||
protected $auth;
|
||||
|
||||
/**
|
||||
* Create a new remove incident command handler instance.
|
||||
*
|
||||
* @param \Illuminate\Contracts\Auth\Guard $auth
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Guard $auth)
|
||||
{
|
||||
$this->auth = $auth;
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle the remove incident command.
|
||||
*
|
||||
@@ -27,7 +47,7 @@ class RemoveIncidentCommandHandler
|
||||
{
|
||||
$incident = $command->incident;
|
||||
|
||||
event(new IncidentWasRemovedEvent($incident));
|
||||
event(new IncidentWasRemovedEvent($this->auth->user(), $incident));
|
||||
|
||||
$incident->delete();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user