Add event action storage. Closes #2344

This commit is contained in:
James Brooks
2017-02-03 22:34:13 +00:00
parent c2790e29cc
commit 3dc154dff1
92 changed files with 1512 additions and 128 deletions

View File

@@ -19,6 +19,7 @@ use CachetHQ\Cachet\Models\Component;
use CachetHQ\Cachet\Models\Incident;
use CachetHQ\Cachet\Models\IncidentTemplate;
use CachetHQ\Cachet\Services\Dates\DateFactory;
use Illuminate\Contracts\Auth\Guard;
use Twig_Environment;
use Twig_Loader_Array;
@@ -29,6 +30,13 @@ use Twig_Loader_Array;
*/
class UpdateIncidentCommandHandler
{
/**
* The authentication guard instance.
*
* @var \Illuminate\Contracts\Auth\Guard
*/
protected $auth;
/**
* The date factory instance.
*
@@ -39,12 +47,14 @@ class UpdateIncidentCommandHandler
/**
* Create a new update incident command handler instance.
*
* @param \Illuminate\Contracts\Auth\Guard $auth
* @param \CachetHQ\Cachet\Services\Dates\DateFactory $dates
*
* @return void
*/
public function __construct(DateFactory $dates)
public function __construct(Guard $auth, DateFactory $dates)
{
$this->auth = $auth;
$this->dates = $dates;
}
@@ -91,7 +101,7 @@ class UpdateIncidentCommandHandler
));
}
event(new IncidentWasUpdatedEvent($incident));
event(new IncidentWasUpdatedEvent($this->auth->user(), $incident));
return $incident;
}