requesterIsAdmin) { throw new ForbiddenException( 'only admins can unfeature a post' ); } if ($request->postId <= 0) { throw new BadRequestException('postId must be positive'); } $post = $this->postRepo->find($request->postId); if ($post === null) { return; } if (! $post->isFeatured()) { return; } $this->postRepo->update(new Post( id: $post->getId(), userId: $post->getUserId(), title: $post->getTitle(), body: $post->getBody(), createdAt: $post->getCreatedAt(), featureSlot: null, )); } }