Skip to content

Open-source event management and ticket selling platform — perfect for concerts, conferences, and everything in between 🎟️ If you find this project helpful, please consider giving us a star ⭐️

681 B
Raw Blame
<?php

namespace HiEvents\Http\Actions\EventOccurrences;

use HiEvents\DomainObjects\EventDomainObject;
use HiEvents\Http\Actions\BaseAction;
use HiEvents\Services\Application\Handlers\EventOccurrence\DeleteEventOccurrenceHandler;
use Illuminate\Http\Response;

class DeleteEventOccurrenceAction extends BaseAction
{
    public function __construct(
        private readonly DeleteEventOccurrenceHandler $handler,
    ) {}

    public function __invoke(int $eventId, int $occurrenceId): Response
    {
        $this->isActionAuthorized($eventId, EventDomainObject::class);

        $this->handler->handle($eventId, $occurrenceId);

        return $this->deletedResponse();
    }
}