{"id":15101394,"url":"https://github.com/contentful/the-example-app.php","last_synced_at":"2025-10-08T08:32:26.017Z","repository":{"id":38172468,"uuid":"110671777","full_name":"contentful/the-example-app.php","owner":"contentful","description":"Example app for Contentful in PHP","archived":true,"fork":false,"pushed_at":"2023-01-18T09:37:25.000Z","size":896,"stargazers_count":18,"open_issues_count":1,"forks_count":22,"subscribers_count":32,"default_branch":"master","last_synced_at":"2024-10-02T07:42:33.481Z","etag":null,"topics":["contentful","docker","heroku","php","php72","symfony","symfony4"],"latest_commit_sha":null,"homepage":"https://the-example-app-php.contentful.com","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/contentful.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-11-14T09:50:31.000Z","updated_at":"2024-01-14T20:28:13.000Z","dependencies_parsed_at":"2023-01-19T15:16:39.438Z","dependency_job_id":null,"html_url":"https://github.com/contentful/the-example-app.php","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/contentful%2Fthe-example-app.php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/contentful%2Fthe-example-app.php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/contentful%2Fthe-example-app.php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/contentful%2Fthe-example-app.php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/contentful","download_url":"https://codeload.github.com/contentful/the-example-app.php/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235700110,"owners_count":19031668,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["contentful","docker","heroku","php","php72","symfony","symfony4"],"created_at":"2024-09-25T18:22:11.720Z","updated_at":"2025-10-08T08:32:20.575Z","avatar_url":"https://github.com/contentful.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003e **Note**: This repo is no longer officially maintained as of Jan, 2023.\n\u003e Feel free to use it, fork it and patch it for your own needs.\n\n## The PHP example app\n\n[![CircleCI](https://img.shields.io/circleci/project/github/contentful/the-example-app.php.svg)](https://circleci.com/gh/contentful/the-example-app.php)\n\nThe PHP example app teaches the very basics of how to work with Contentful:\n\n- consume content from the Contentful Delivery and Preview APIs\n- model content\n- edit content through the Contentful web app\n\nThe app demonstrates how decoupling content from its presentation enables greater flexibility and facilitates shipping higher quality software more quickly.\n\n\u003ca href=\"https://the-example-app-php.herokuapp.com/\" target=\"_blank\"\u003e\u003cimg src=\"https://images.contentful.com/88dyiqcr7go8/2VvMC41pxmCmwEyyAWCCmQ/3d1288376fb1846544572e2eb0b2a5b5/the-example-app-php.herokuapp.com.png\" alt=\"Screenshot of the example app\"/\u003e\u003c/a\u003e\n\nYou can see a hosted version of `The PHP example app` on \u003ca href=\"https://the-example-app-php.herokuapp.com/\" target=\"_blank\"\u003eHeroku\u003c/a\u003e.\n\n## What is Contentful?\n[Contentful](https://www.contentful.com) provides a content infrastructure for digital teams to power content in websites, apps, and devices. Unlike a CMS, Contentful was built to integrate with the modern software stack. It offers a central hub for structured content, powerful management and delivery APIs, and a customizable web app that enable developers and content creators to ship digital products faster.\n\n## Requirements\n\n* PHP 7.2\n* Git\n* Contentful CLI (only for write access)\n\nWithout any changes, this app is connected to a Contentful space with read-only access. To experience the full end-to-end Contentful experience, you need to connect the app to a Contentful space with read _and_ write access. This enables you to see how content editing in the Contentful web app works and how content changes propagate to this app.\n\n## Common setup\n\nClone the repo and install the dependencies.\n\n``` bash\ngit clone https://github.com/contentful/the-example-app.php.git\n```\n\n``` bash\ncomposer install\n```\n\n## Steps for read-only access\n\nTo start the local server, run the following:\n\n``` bash\nphp bin/console server:run\n```\n\nOpen [http://localhost:8000](http://localhost:8000) and take a look around.\n\n## Steps for read and write access (recommended)\n\nStep 1: Install the [Contentful CLI](https://www.npmjs.com/package/contentful-cli).\n\nStep 2: Login to Contentful through the CLI. It will help you to create a [free account](https://www.contentful.com/sign-up/) if you don't have one already.\n\n``` bash\ncontentful login\n```\n\nStep 3: Create a new space.\n\n``` bash\ncontentful space create --name 'My space for the example app'\n```\n\nStep 4: Seed the new space with the content model. Replace the `SPACE_ID` with the id returned from the create command executed in step 3.\n\n``` bash\ncontentful space seed -s '\u003cSPACE_ID\u003e' -t the-example-app\n```\n\nStep 5: Head to the Contentful web app's API section and grab `SPACE_ID`, `DELIVERY_ACCESS_TOKEN`, `PREVIEW_ACCESS_TOKEN`.\n\nStep 6: Open `.env` and inject your credentials so it looks like this\n\n```\n// ...\nCONTENTFUL_SPACE_ID=\u003cSPACE_ID\u003e\nCONTENTFUL_DELIVERY_TOKEN=\u003cDELIVERY_ACCESS_TOKEN\u003e\nCONTENTFUL_PREVIEW_TOKEN=\u003cPREVIEW_ACCESS_TOKEN\u003e\n```\n\nStep 7: To start the local server, run the following.\n\n``` bash\nphp bin/console server:run\n```\nFinal Step:\n\nOpen [http://localhost:8000/?editorial_features=enabled](http://localhost:8000/?editorial_features=enabled) and take a look around. This URL flag adds an “Edit” button in the app on every editable piece of content which will take you back to Contentful web app where you can make changes. It also adds “Draft” and “Pending Changes” status indicators to all content if relevant.\n\n\n## Use Docker\nYou can also run this app as a Docker container:\n\nStep 1: Clone the repo\n\n```bash\ngit clone https://github.com/contentful/the-example-app.php.git\n```\n\nStep 2: Build the Docker images\n\n```bash\ndocker-compose build\n```\n\nStep 3: Run the Docker containers locally:\n\n```bash\ndocker-compose up\n```\n\nIf you created your own Contentful space, you can use it by overriding the following environment variables in the `docker-compose` file:\n\n```bash\nenvironment:\n - CONTENTFUL_SPACE_ID=\u003cSPACE_ID\u003e\n - CONTENTFUL_DELIVERY_TOKEN=\u003cDELIVERY_ACCESS_TOKEN\u003e\n - CONTENTFUL_PREVIEW_TOKEN=\u003cPREVIEW_ACCESS_TOKEN\u003e\n```\n\n## Deploy to Heroku\n\nYou can also deploy this app to Heroku:\n\n[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcontentful%2Fthe-example-app.php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcontentful%2Fthe-example-app.php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcontentful%2Fthe-example-app.php/lists"}