validate([ 'channel' => ['required', Rule::enum(PressReleaseShareChannel::class)], ]); $context = WebPortalContext::fromRequest(); $release = PressRelease::query() ->withoutGlobalScope(PortalScope::class) ->forPortalValues($context->portalValues) ->forLanguage($context->language) ->visibleInArchive() ->where('slug', $slug) ->firstOrFail(); $release->events()->create([ 'type' => PressReleaseEventType::Share, 'channel' => $validated['channel'], ]); return response()->noContent(); } }