Skip to content

Instantly share code, notes, and snippets.

@dgafka
Created July 28, 2021 16:39
Show Gist options
  • Save dgafka/ab4d879d79514c658297a3ebc40328b9 to your computer and use it in GitHub Desktop.
Save dgafka/ab4d879d79514c658297a3ebc40328b9 to your computer and use it in GitHub Desktop.
<?php
class PersonController
{
public function __construct(private QueryBus $queryBus) {}
public function getShippingAddress(Request $request)
{
$userId = $request->get('userId');
$shippingAddress = $this->queryBus->send(new GetUserShippingAddressQuery($userId));
// serialize if needed and return response
return new Response($shippingAddress);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment