*/ class DeleteScheduleCommandHandler { /** * The authentication guard instance. * * @var \Illuminate\Contracts\Auth\Guard */ protected $auth; /** * Create a new delete schedule command handler instance. * * @param \Illuminate\Contracts\Auth\Guard $auth * * @return void */ public function __construct(Guard $auth) { $this->auth = $auth; } /** * Handle the delete schedule command. * * @param \CachetHQ\Cachet\Bus\Commands\Schedule\DeleteScheduleCommand $command * * @return void */ public function handle(DeleteScheduleCommand $command) { $schedule = $command->schedule; event(new ScheduleWasRemovedEvent($this->auth->user(), $schedule)); $schedule->delete(); } }