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\OrganizerDomainObject;
use HiEvents\Http\Actions\BaseAction;
use HiEvents\Http\Request\Lineup\UpsertProfileRequest;
use HiEvents\Http\ResponseCodes;
use HiEvents\Resources\Lineup\ProfileResource;
use HiEvents\Services\Application\Handlers\Lineup\DTO\UpsertProfileDTO;
use HiEvents\Services\Application\Handlers\Lineup\UpsertProfileHandler;
use Illuminate\Http\JsonResponse;
class UpdateProfileAction extends BaseAction
{
public function __construct(
private readonly UpsertProfileHandler $handler,
) {}
public function __invoke(int $organizerId, int $profileId, UpsertProfileRequest $request): JsonResponse
{
$this->isActionAuthorized($organizerId, OrganizerDomainObject::class);
$profile = $this->handler->handle(new UpsertProfileDTO(
account_id: $this->getAuthenticatedAccountId(),
organizer_id: $organizerId,
name: $request->validated('name'),
tagline: $request->validated('tagline'),
bio: $request->validated('bio'),
links: $request->validated('links') ?? [],
profile_id: $profileId,
));
return $this->resourceResponse(
resource: ProfileResource::class,
data: $profile,
statusCode: ResponseCodes::HTTP_OK,
);
}
}