Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions core/errors.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ final class ProductManager implements EventSubscriberInterface
}
```

If you use the standard distribution of API Platform, this event listener will be automatically
registered. If you use a custom installation, [learn how to extend API Platform](extending.md).
If you use the API Platform Symfony variant, this event listener will be automatically registered.
If you use a custom installation, [learn how to extend API Platform](extending.md).

Then, configure the framework to catch `App\Exception\ProductNotFoundException` exceptions and
convert them into `404` errors:
Expand Down
6 changes: 3 additions & 3 deletions core/events.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,9 @@ final class BookMailSubscriber implements EventSubscriberInterface
}
```

If you use the official API Platform distribution, creating the previous class is enough. The
Symfony DependencyInjection component will automatically register this subscriber as a service and
will inject its dependencies thanks to the
If you use the API Platform Symfony variant, creating the previous class is enough. The Symfony
DependencyInjection component will automatically register this subscriber as a service and will
inject its dependencies thanks to the
[autowiring feature](https://symfony.com/doc/current/service_container/autowiring.html).

Alternatively,
Expand Down
2 changes: 1 addition & 1 deletion core/filters.md
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ because `bar` is not a supported parameter.

> [!NOTE] We strongly recommend using [Vulcain](https://vulcain.rocks) instead of this filter.
> Vulcain is faster, allows a better hit rate, and is supported out of the box in the API Platform
> distribution. [!NOTE] When unsing JSON:API check out the
> Symfony variant. [!NOTE] When unsing JSON:API check out the
> [specific SparseFieldset and Sort filters](./content-negotiation/#jsonapi-sparse-fieldset-and-sort-parameters)

The property filter adds the possibility to select the properties to serialize (sparse fieldsets).
Expand Down
4 changes: 2 additions & 2 deletions core/mercure.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ Mercure hub. Then, the Mercure hub dispatches the updates to all connected clien
## Installing Mercure Support

Mercure support is already installed, configured and enabled in
[the API Platform Symfony variant](../symfony/index.md). If you use the distribution, you have
nothing more to do, and you can skip to the next section.
[the API Platform Symfony variant](../symfony/index.md). If you use it, you have nothing more to do,
and you can skip to the next section.

If you installed API Platform using another method (e.g., `composer require api`), you will need to
set up the following:
Expand Down
4 changes: 2 additions & 2 deletions core/mongodb.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ extension and not on the legacy [mongo](https://secure.php.net/manual/en/book.mo
If the `mongodb` PHP extension is not installed yet,
[install it beforehand](https://secure.php.net/manual/en/mongodb.installation.pecl.php).

Or if you are using the [API Platform Distribution with Symfony](../symfony/index.md), modify the
`Dockerfile` to add the extension:
Or if you are using the [API Platform Symfony variant](../symfony/index.md) with Docker, modify the
`api/Dockerfile` to add the extension:

```diff
# api/Dockerfile
Expand Down
12 changes: 6 additions & 6 deletions core/performance.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ document is added or removed or for relationships and inverse relations is built

#### Built-in Caddy HTTP Cache

The API Platform distribution relies on the [Caddy web server](https://caddyserver.com) which
provides an official HTTP cache module called
The Docker setup of the API Platform Symfony variant relies on the
[Caddy web server](https://caddyserver.com) which provides an official HTTP cache module called
[cache-handler](https://github.com/caddyserver/cache-handler), that is based on
[Souin](https://github.com/darkweak/souin).

Expand Down Expand Up @@ -332,18 +332,18 @@ class Book

Computing metadata used by the bundle is a costly operation. Fortunately, metadata can be computed
once and then cached. API Platform internally uses a [PSR-6](https://www.php-fig.org/psr/psr-6/)
cache. If the Symfony Cache component is available (the default in the API Platform distribution),
it automatically enables support for the best cache adapter available.
cache. If the Symfony Cache component is available (the default in the API Platform Symfony
variant), it automatically enables support for the best cache adapter available.

Best performance is achieved using [APCu](https://github.com/krakjoe/apcu). Be sure to have the APCu
extension installed on your production server (this is the case by default in the Docker image
provided by the API Platform distribution). API Platform will automatically use it.
provided by the API Platform Symfony variant). API Platform will automatically use it.

## Using FrankenPHP's Worker Mode

API response times can be significantly improved by enabling
[FrankenPHP's worker mode](https://frankenphp.dev/docs/worker/). This feature is enabled by default
in the production environment of the API Platform distribution.
in the production environment of the API Platform Symfony variant.

## Doctrine Queries and Index

Expand Down
6 changes: 3 additions & 3 deletions core/push-relations.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ API Platform leverages this capability by pushing relations of a resource to cli

> [!NOTE] We strongly recommend using [Vulcain](https://vulcain.rocks) instead of this feature.
> Vulcain is faster, cleaner, more flexible, and is supported out of the box in
> [the API Platform distribution](../symfony/index.md).
> [the API Platform Symfony variant](../symfony/index.md).

```php
<?php
Expand All @@ -37,8 +37,8 @@ automatically add a valid `Link` HTTP header with the `preload` relation. Accord
servers and proxy servers can read this header, fetch the related resource and send it to the client
using Server Push.

With the Caddy web server (the server shipped as part of the [distribution](../symfony/index.md)),
you must add [the `push` directive](https://caddyserver.com/docs/caddyfile/directives/push) to your
With the Caddy web server (the server shipped with the [Docker setup](../symfony/index.md)), you
must add [the `push` directive](https://caddyserver.com/docs/caddyfile/directives/push) to your
`Caddyfile` to be able to use this feature.

[NGINX](https://www.nginx.com/blog/nginx-1-13-9-http2-server-push/),
Expand Down
6 changes: 3 additions & 3 deletions core/serialization.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ Just like other Symfony and API Platform components, the Serializer component ca
using attributes, XML or YAML. Since attributes are easy to understand, we will use them in the
following examples.

> [!NOTE] If you are not using the API Platform distribution, you need to enable annotation support
> in the serializer configuration as outlined below, depending on your Symfony version.
> [!NOTE] If you are not using the API Platform Symfony variant, you need to enable annotation
> support in the serializer configuration as outlined below, depending on your Symfony version.

#### Configuration for Symfony `<= 6.4`

Expand Down Expand Up @@ -401,7 +401,7 @@ requests.

**Note:** We strongly recommend using [Vulcain](https://vulcain.rocks) instead of this feature.
Vulcain allows creating faster (better hit rate) and better designed APIs than relying on compound
documents, and is supported out of the box in the API Platform distribution.
documents, and is supported out of the box in the API Platform Symfony variant.

### Normalization

Expand Down
4 changes: 2 additions & 2 deletions create-client/nextjs.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ The generated HTML will contain [Tailwind CSS](https://tailwindcss.com) classes.

## Generating Routes

If you are using the [API Platform Distribution with Symfony](../symfony/index.md) generating all
the code you need for a given resource is as simple as running the following command:
If you are using the [API Platform Symfony variant](../symfony/index.md) generating all the code you
need for a given resource is as simple as running the following command:

```console
docker compose exec pwa \
Expand Down
13 changes: 11 additions & 2 deletions deployment/kubernetes.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,17 @@ containers in production. [Google Cloud Platform](https://cloud.google.com/kuber
[Amazon Web Services](https://aws.amazon.com/eks/) and many more companies provide managed
Kubernetes environment.

[The API Platform symfony variant](../symfony/index.md) contains a built-in [Helm](https://helm.sh/)
(the k8s package manager) chart to deploy in a wink on any of these platforms.
API Platform can be deployed to any of these platforms with a [Helm](https://helm.sh/) (the k8s
package manager) chart.

> [!NOTE]
>
> The Helm chart is no longer bundled with the project scaffolded by the `api-platform` installer. A
> reworked chart is in the works. In the meantime, you can use the chart preserved in the `4.1`
> release of the distribution: copy the
> [`helm/api-platform`](https://github.com/api-platform/api-platform/tree/v4.1.0/helm/api-platform)
> directory from that tag into your project, and adapt it to your image names and project layout.
> The commands below assume it is available at `./helm/api-platform`.

This guide is based on Helm 3.

Expand Down
3 changes: 2 additions & 1 deletion deployment/minikube.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ The previous command starts minikube with a Docker registry (we'll use it in the
the Kubernetes dashboard.

Finally, [install Helm](https://helm.sh/docs/intro/install/). We'll use it to deploy the application
in the cluster thanks to the chart provided in the API Platform distribution.
in the cluster thanks to a Helm chart (see the [Kubernetes guide](kubernetes.md) for how to obtain
it).

## Building and Pushing Docker Images

Expand Down
4 changes: 2 additions & 2 deletions laravel/filters.md
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,8 @@ Examples:
### PropertyFilter

Note: We strongly recommend using [Vulcain](https://vulcain.rocks) instead of this filter. Vulcain
is faster, allows a better hit rate, and is supported out of the box in the API Platform
distribution.
is faster, allows a better hit rate, and is supported out of the box in the API Platform Symfony
variant.

The property filter adds the possibility to select the properties to serialize (sparse fieldsets).

Expand Down
30 changes: 30 additions & 0 deletions laravel/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,36 @@ With API Platform, you can:

Let's discover how to use API Platform with Laravel!

## Scaffolding a New Project (Recommended)

The fastest way to start a new project is the **`api-platform` installer**, a command-line tool that
creates a ready-to-use Laravel project with API Platform pre-installed.

Download the latest release for your platform from the
[Releases page](https://github.com/api-platform/api-platform/releases/latest) and move the binary
somewhere on your `$PATH`:

```console
curl -L https://github.com/api-platform/api-platform/releases/latest/download/api-platform-linux-x86_64 -o /usr/local/bin/api-platform
chmod +x /usr/local/bin/api-platform
```

Alternatively, if you already have PHP and [Composer](https://getcomposer.org/) installed, install
it globally with `composer global require api-platform/installer`.

Then scaffold the project:

```console
api-platform my-api-platform-laravel-app --framework=laravel
```

The installer creates the Laravel application, requires `api-platform/laravel`, and runs
`php artisan api-platform:install` for you. Once it finishes, start the server with
`php artisan serve` and open `http://127.0.0.1:8000/api/`.

If you prefer to install API Platform manually, or you want to add it to an existing Laravel
project, follow the sections below instead.

## Installing Laravel

API Platform can be installed easily on new and existing Laravel projects. If you already have an
Expand Down
10 changes: 4 additions & 6 deletions laravel/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -462,21 +462,19 @@ Running your test suite in your
[CI/CD pipeline](https://en.wikipedia.org/wiki/Continuous_integration) is important to ensure good
quality and delivery time.

The API Platform distribution is
[shipped with a GitHub Actions workflow](https://github.com/api-platform/api-platform/blob/main/.github/workflows/ci.yml)
The API Platform Demo is
[shipped with a GitHub Actions workflow](https://github.com/api-platform/demo/tree/main/.github/workflows)
that builds the Docker images, does a
[smoke test](<https://en.wikipedia.org/wiki/Smoke_testing_(software)>) to check that the
application's entrypoint is accessible, and runs PHPUnit.

The API Platform Demo
[contains a CD workflow](https://github.com/api-platform/demo/tree/main/.github/workflows) that uses
[the Helm chart provided with the distribution](../deployment/kubernetes.md) to deploy the app on a
Kubernetes cluster.
[a Helm chart](../deployment/kubernetes.md) to deploy the app on a Kubernetes cluster.

## Additional and Alternative Testing Tools

You may also be interested in these alternative testing tools (not included in the API Platform
distribution):
You may also be interested in these alternative testing tools (not included by default):

- [Hoppscotch](https://docs.hoppscotch.io/features/tests), create functional test for your API
- [Behat](https://behat.org), a
Expand Down
4 changes: 2 additions & 2 deletions schema-generator/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

## Installation

If you use [the API Platform Distribution with Symfony](../symfony/index.md), the Schema Generator
is already installed as a development dependency of your project and can be invoked with:
If you use [the API Platform Symfony variant](../symfony/index.md), the Schema Generator is already
installed as a development dependency of your project and can be invoked with:

```console
vendor/bin/schema
Expand Down
2 changes: 1 addition & 1 deletion symfony/caddy.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Configuring the Caddy Web Server with Symfony

[The API Platform distribution](index.md) is shipped with
[The API Platform Symfony variant](index.md), when generated with Docker, is shipped with
[the Caddy web server](https://caddyserver.com). The build contains the
[Mercure](../core/mercure.md) and the [Vulcain](https://vulcain.rocks) Caddy modules.

Expand Down
4 changes: 2 additions & 2 deletions symfony/controllers.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Internally, API Platform implements the [Action-Domain-Responder](https://github
pattern (ADR), a web-specific refinement of
[MVC](https://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller).

The distribution of API Platform also eases the implementation of the ADR pattern: it automatically
The API Platform Symfony variant also eases the implementation of the ADR pattern: it automatically
registers action classes stored in `api/src/Controller` as autowired services.

Thanks to the [autowiring](https://symfony.com/doc/current/service_container/autowiring.html)
Expand Down Expand Up @@ -85,7 +85,7 @@ corresponding to the ID passed in the URL.

Here we consider that
[autowiring](https://symfony.com/doc/current/service_container/autowiring.html) is enabled for
controller classes (the default when using the API Platform distribution). This action will be
controller classes (the default when using the API Platform Symfony variant). This action will be
automatically registered as a service (the service name is the same as the class name:
`App\Controller\CreateBookPublication`).

Expand Down
3 changes: 2 additions & 1 deletion symfony/debugging.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
## Xdebug

For development purposes such as debugging tests or remote API requests,
[Xdebug](https://xdebug.org/) is shipped by default with the API Platform distribution.
[Xdebug](https://xdebug.org/) is shipped by default with the Docker setup of the API Platform
Symfony variant.

To enable it, run:

Expand Down
Loading
Loading