I'm using this code to get all my content in Contentful (they are projects and within each project a gallery of images) for a simple portfolio website.
$client = new \Contentful\Delivery\Client('xxx-xxx-xxx', 'xxx', 'master');
$query = (new Contentful\Delivery\Query())->setContentType('MyPortfolio')->orderBy('-fields.createdOn');
$entries = $client->getEntries($query);
what I do not understand is how to filter and get only one project, given I have its ID (the id is coming from $_GET
passed in the url.
This may be super rookie, but can you help me?
Try this:
$client->getEntry($assetId);