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: laravel/index.md
+14-5Lines changed: 14 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,9 +8,9 @@ using Laravel!
8
8
With API Platform, you can:
9
9
10
10
*[expose your Eloquent](#exposing-a-model) models in minutes as:
11
-
* a REST API implementing the industry-leading standards, formats and best practices: [JSON-LD](https://en.wikipedia.org/wiki/JSON-LD)/[RDF](https://en.wikipedia.org/wiki/Resource_Description_Framework), [JSON:API](https://jsonapi.org), [HAL](https://stateless.group/hal_specification.html), and many RFCs...
12
-
* a [GraphQL](https://graphql.org/) API
13
-
* or both at the same time, with the same code!
11
+
* a REST API implementing the industry-leading standards, formats and best practices: [JSON-LD](https://en.wikipedia.org/wiki/JSON-LD)/[RDF](https://en.wikipedia.org/wiki/Resource_Description_Framework), [JSON:API](https://jsonapi.org), [HAL](https://stateless.group/hal_specification.html), and many RFCs...
12
+
* a [GraphQL](https://graphql.org/) API
13
+
* or both at the same time, with the same code!
14
14
* automatically expose an [OpenAPI](https://www.openapis.org) specification (formerly Swagger), dynamically generated from your Eloquent models and always up to date
15
15
* automatically expose nice UIs and playgrounds to develop using your API ([Swagger UI](https://swagger.io/tools/swagger-ui/) and [GraphiQL](https://github.com/graphql/graphiql))
16
16
* automatically paginate your collections
@@ -53,6 +53,14 @@ Open `http://127.0.0.1:8000/api/`, your API is already active and documented...
53
53
54
54

55
55
56
+
## Publishing the Config File and Assets
57
+
58
+
After installing API Platform, you can publish its assets and config using the `api-platform:install` Artisan command.
59
+
60
+
```console
61
+
php artisan api-platform:install
62
+
```
63
+
56
64
## Creating an Eloquent Model
57
65
58
66
To discover how API Platform framework works, we will create an API to manage a bookshop.
@@ -63,7 +71,7 @@ Let's start by creating a `Book` model:
63
71
php artisan make:model Book
64
72
```
65
73
66
-
By default, Laravel uses SQLite. You can open the `database/database.sqlite` file with your preferred SQLite client (PHPStorm works like a charm), create a table named `books`, and add some columns, Eloquent and API Platform will detect these columns automatically.
74
+
By default, Laravel uses SQLite. You can open the `database/database.sqlite` file with your preferred SQLite client (PhpStorm works like a charm), create a table named `books`, and add some columns, Eloquent and API Platform will detect these columns automatically.
67
75
68
76
But there is a better alternative: using a migration class.
69
77
@@ -673,7 +681,8 @@ occurs**.
673
681
674
682

675
683
676
-
API Platform also has an awesome [client generator](../create-client/index.md) able to scaffold fully working [Next.js](../create-client/nextjs.md), [Nuxt.js](../create-client/nuxt.md), [React/Redux](../create-client/react.md), [Vue.js](../create-client/vuejs.md), [Quasar](../create-client/quasar.md), and [Vuetify](../create-client/vuetify.md) Progressive Web Apps/Single Page Apps that you can easily tune and customize. The generator also supports
684
+
API Platform also has an awesome [client generator](../create-client/index.md) able to scaffold fully working [Next.js](../create-client/nextjs.md), [Nuxt.js](../create-client/nuxt.md), [React/Redux](../create-client/react.md), [Vue.js](../create-client/vuejs.md), [Quasar](../create-client/quasar.md),
685
+
and [Vuetify](../create-client/vuetify.md) Progressive Web Apps/Single Page Apps that you can easily tune and customize. The generator also supports
677
686
[React Native](../create-client/react-native.md) if you prefer to leverage all capabilities of mobile devices.
0 commit comments