In 20 years of PHP, the web changed dramatically and is now evolving faster than ever:
- Since 2014 internet users spend more time on their mobile devices than on desktops: having a responsive website is mandatory and native mobile apps are a must-have.
- The semantic web and especially Linked Data is a reality: with the Schema.org initiative and new open web standards such as JSON-LD, search engines (among a bunch of other services and software) consume structured and machine-readable data at web scale. Not exposing such data decrease interoperability and search engine ranking/efficiency (think rich snippets).
PHP.net, Symfony, Facebook and many others have worked hard to improve and professionalize the PHP ecosystem. The PHP world has closed the gap with most backend solutions and is often more innovative than them.
However in critical areas I've described previously, many things can be improved. Almost all existing solutions are still designed and documented to create websites the old way: a server generates then sends plain-old HTML documents to browsers.
API Platform is a set of tools for building modern web projects. It is a framework for API-first projects built on top of Symfony. Like other modern frameworks such as Zend Framework and Symfony, it's both a full-stack all-in-one framework and a set of independent PHP components and bundles that can be used separately.
Many of you will distrust the architecture promoted by the framework but read this tutorial until the end and you will see how API Platform makes modern development easy and fun again:
- Start by creating a hypermedia REST API exposing structured data that can be understood by any compliant client such as your apps but also search engines (JSON-LD with Schema.org vocabulary). This API is the central and unique entry point to access and modify data. It also encapsulates the whole business logic.