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 ⭐️
PHP attendize-alternativedoor-managementevent-check-inevent-managementevent-registrationevent-ticketingeventbrite-alternativeeventslaravelopen-sourcephpreactself-hostedsell-ticketssell-tickets-onlineticket-sellingticketing-systemtickettailor-alternativetito-alternative
<?php
declare(strict_types=1);
namespace HiEvents\Http\Actions\Lineup;
use HiEvents\DomainObjects\Enums\LineupBillingTier;
use HiEvents\DomainObjects\EventDomainObject;
use HiEvents\Http\Actions\BaseAction;
use HiEvents\Http\Request\Lineup\UpdateLineupEntryRequest;
use HiEvents\Http\ResponseCodes;
use HiEvents\Resources\Lineup\LineupEntryResource;
use HiEvents\Services\Application\Handlers\Lineup\DTO\UpsertLineupEntryDTO;
use HiEvents\Services\Application\Handlers\Lineup\UpsertLineupEntryHandler;
use Illuminate\Http\JsonResponse;
class UpdateLineupEntryAction extends BaseAction
{
public function __construct(
private readonly UpsertLineupEntryHandler $handler,
) {}
public function __invoke(int $eventId, int $lineupEntryId, UpdateLineupEntryRequest $request): JsonResponse
{
$this->isActionAuthorized($eventId, EventDomainObject::class);
$entry = $this->handler->handle(new UpsertLineupEntryDTO(
event_id: $eventId,
billing_tier: LineupBillingTier::from($request->validated('billing_tier')),
role_label: $request->validated('role_label'),
is_hidden: $request->has('is_hidden') ? $request->boolean('is_hidden') : null,
lineup_entry_id: $lineupEntryId,
));
return $this->resourceResponse(
resource: LineupEntryResource::class,
data: $entry,
statusCode: ResponseCodes::HTTP_OK,
);
}
}