Skip to content

Commit 1c2a4e4

Browse files
authored
fix(laravel): installation (#1989)
add install command to installation guide
1 parent f7ea086 commit 1c2a4e4

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

laravel/index.md

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ using Laravel!
88
With API Platform, you can:
99

1010
* [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!
1414
* automatically expose an [OpenAPI](https://www.openapis.org) specification (formerly Swagger), dynamically generated from your Eloquent models and always up to date
1515
* 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))
1616
* automatically paginate your collections
@@ -53,6 +53,14 @@ Open `http://127.0.0.1:8000/api/`, your API is already active and documented...
5353

5454
![Empty docs](images/empty-docs.png)
5555

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+
5664
## Creating an Eloquent Model
5765

5866
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:
6371
php artisan make:model Book
6472
```
6573

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.
6775

6876
But there is a better alternative: using a migration class.
6977

@@ -673,7 +681,8 @@ occurs**.
673681

674682
![The Next.js Progressive Web App](../symfony/images/api-platform-2.6-pwa-react.png)
675683

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
677686
[React Native](../create-client/react-native.md) if you prefer to leverage all capabilities of mobile devices.
678687

679688

0 commit comments

Comments
 (0)