You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: distribution/index.md
+26-26Lines changed: 26 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@
10
10
11
11
## Introduction
12
12
13
-
API Platform contains [a **PHP** library (Core)](../core/index.md) to create fully featured hypermedia (or [GraphQL](../core/graphql.md)) web APIs supporting industry-leading standards: [JSON-LD](https://json-ld.org/) with [Hydra](https://www.hydra-cg.com/), [OpenAPI](../core/swagger.md)...
13
+
API Platform contains [a **PHP** library (Core)](../core/index.md) to create fully featured hypermedia (or [GraphQL](../core/graphql.md)) web APIs supporting industry-leading standards: [JSON-LD](https://json-ld.org) with [Hydra](https://www.hydra-cg.com), [OpenAPI](../core/swagger.md)...
14
14
15
15
API Platform also provides ambitious **JavaScript** tools to create web and mobile applications based on the most popular frontend technologies in a snap. These tools parse the documentation of the API (or of any other API supporting Hydra or OpenAPI).
16
16
@@ -43,7 +43,7 @@ API Platform uses these model classes to expose and document a web API having a
43
43
* hypermedia/[HATEOAS](https://en.wikipedia.org/wiki/HATEOAS) and content negotiation support ([JSON-LD](https://json-ld.org) and [Hydra](https://www.hydra-cg.com/), [JSON:API](https://jsonapi.org/), [HAL](https://tools.ietf.org/html/draft-kelly-json-hal-08)...)
44
44
*[GraphQL support](../core/graphql.md)
45
45
* Nice UI and machine-readable documentations ([Swagger UI/OpenAPI](https://swagger.io), [GraphiQL](https://github.com/graphql/graphiql)...)
46
-
* authentication ([Basic HTTP](https://en.wikipedia.org/wiki/Basic_access_authentication), cookies as well as [JWT](https://jwt.io/) and [OAuth](https://oauth.net/) through extensions)
46
+
* authentication ([Basic HTTP](https://en.wikipedia.org/wiki/Basic_access_authentication), cookies as well as [JWT](../core/jwt.md) and [OAuth](https://oauth.net) through extensions)
@@ -141,7 +141,7 @@ That being said, keep in mind that API Platform is 100% independent of the persi
141
141
best suit(s) your needs (including NoSQL databases or remote web services) by implementing the [right interfaces](../core/data-providers.md). API Platform even supports using several persistence
142
142
systems together in the same project.
143
143
144
-
### Using Symfony and Composer
144
+
### Using Symfony CLI
145
145
146
146
Alternatively, the API Platform server component can also be installed directly on a local machine.
147
147
**This method is recommended only for users who want full control over the directory structure and the installed
@@ -153,12 +153,12 @@ The rest of this tutorial assumes that you have installed API Platform using the
153
153
next section if it's your case.
154
154
155
155
API Platform has an official Symfony Flex recipe. It means that you can easily install it from any Symfony
156
-
application using [Composer](https://getcomposer.org/):
156
+
application using [the Symfony binary](https://symfony.com/download):
Install the API Platform's server component in this skeleton:
171
171
172
172
```console
173
-
composer require api
173
+
symfony composer require api
174
174
```
175
175
176
176
Then, create the database and its schema:
177
177
178
178
```console
179
-
bin/console doctrine:database:create
180
-
bin/console doctrine:schema:create
179
+
symfony console doctrine:database:create
180
+
symfony console doctrine:schema:create
181
181
```
182
182
183
183
And start the built-in PHP server:
184
184
185
185
```console
186
-
php -S 127.0.0.1:8000 -t public
186
+
symfony serve
187
187
```
188
188
189
189
All JavaScript components are also [available as standalone libraries](https://github.com/api-platform?language=javascript)
@@ -202,7 +202,7 @@ You'll need to add a security exception in your browser to accept the self-signe
202
202
for this container when installing the framework.
203
203
204
204
Later you will probably replace this welcome screen by the homepage of your Next.js application. If you don't plan to create
205
-
a Progressive Web App, you can remove the `pwa/` directory and the related lines in `docker-compose*.yaml` (don't do it
205
+
a Progressive Web App, you can remove the `pwa/` directory as well as the related lines in `docker-compose*.yml` and in `api/docker/caddy/Caddyfile` (don't do it
206
206
now, we'll use this container later in this tutorial).
207
207
208
208
Click on the "API" button, or go to `https://localhost/docs/`:
@@ -269,7 +269,7 @@ class Book
269
269
public string $author = '';
270
270
271
271
/** The publication date of this book. */
272
-
public ?\DateTimeInterface $publicationDate = null;
272
+
public ?\DateTimeImmutable $publicationDate = null;
273
273
274
274
/** @var Review[] Available reviews for this book. */
275
275
public iterable $reviews;
@@ -311,7 +311,7 @@ class Review
311
311
public string $author = '';
312
312
313
313
/** The date of publication of this review.*/
314
-
public ?\DateTimeInterface $publicationDate = null;
314
+
public ?\DateTimeImmutable $publicationDate = null;
315
315
316
316
/** The book this review is about. */
317
317
public ?Book $book = null;
@@ -387,19 +387,19 @@ Modify these files as described in these patches:
387
387
public string $title = '';
388
388
389
389
/** The description of this book. */
390
-
+ #[ORM\Column(type: "text")]
390
+
+ #[ORM\Column(type: 'text')]
391
391
public string $description = '';
392
392
393
393
/** The author of this book. */
394
394
+ #[ORM\Column]
395
395
public string $author = '';
396
396
397
397
/** The publication date of this book. */
398
-
+ #[ORM\Column(type: "datetime")]
398
+
+ #[ORM\Column]
399
399
public ?\DateTimeInterface $publicationDate = null;
400
400
401
401
/** @var Review[] Available reviews for this book. */
0 commit comments