Add event action storage. Closes #2344
This commit is contained in:
@@ -15,6 +15,7 @@ use CachetHQ\Cachet\Bus\Commands\Schedule\CreateScheduleCommand;
|
||||
use CachetHQ\Cachet\Bus\Events\Schedule\ScheduleWasCreatedEvent;
|
||||
use CachetHQ\Cachet\Models\Schedule;
|
||||
use CachetHQ\Cachet\Services\Dates\DateFactory;
|
||||
use Illuminate\Contracts\Auth\Guard;
|
||||
|
||||
/**
|
||||
* This is the create schedule command handler.
|
||||
@@ -23,6 +24,13 @@ use CachetHQ\Cachet\Services\Dates\DateFactory;
|
||||
*/
|
||||
class CreateScheduleCommandHandler
|
||||
{
|
||||
/**
|
||||
* The authentication guard instance.
|
||||
*
|
||||
* @var \Illuminate\Contracts\Auth\Guard
|
||||
*/
|
||||
protected $auth;
|
||||
|
||||
/**
|
||||
* The date factory instance.
|
||||
*
|
||||
@@ -33,12 +41,14 @@ class CreateScheduleCommandHandler
|
||||
/**
|
||||
* Create a new update schedule 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;
|
||||
}
|
||||
|
||||
@@ -53,7 +63,7 @@ class CreateScheduleCommandHandler
|
||||
{
|
||||
$schedule = Schedule::create($this->filter($command));
|
||||
|
||||
event(new ScheduleWasCreatedEvent($schedule));
|
||||
event(new ScheduleWasCreatedEvent($this->auth->user(), $schedule));
|
||||
|
||||
return $schedule;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user