Add event action storage. Closes #2344
This commit is contained in:
@@ -14,9 +14,29 @@ namespace CachetHQ\Cachet\Bus\Handlers\Commands\Metric;
|
||||
use CachetHQ\Cachet\Bus\Commands\Metric\AddMetricCommand;
|
||||
use CachetHQ\Cachet\Bus\Events\Metric\MetricWasAddedEvent;
|
||||
use CachetHQ\Cachet\Models\Metric;
|
||||
use Illuminate\Contracts\Auth\Guard;
|
||||
|
||||
class AddMetricCommandHandler
|
||||
{
|
||||
/**
|
||||
* The authentication guard instance.
|
||||
*
|
||||
* @var \Illuminate\Contracts\Auth\Guard
|
||||
*/
|
||||
protected $auth;
|
||||
|
||||
/**
|
||||
* Create a new add metric command handler instance.
|
||||
*
|
||||
* @param \Illuminate\Contracts\Auth\Guard $auth
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Guard $auth)
|
||||
{
|
||||
$this->auth = $auth;
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle the add metric command.
|
||||
*
|
||||
@@ -40,7 +60,7 @@ class AddMetricCommandHandler
|
||||
'visible' => $command->visible,
|
||||
]);
|
||||
|
||||
event(new MetricWasAddedEvent($metric));
|
||||
event(new MetricWasAddedEvent($this->auth->user(), $metric));
|
||||
|
||||
return $metric;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user