From 4963232797964343d64e53f63fc2475b06ba4a9e Mon Sep 17 00:00:00 2001 From: soyuka Date: Thu, 11 Jun 2026 22:10:01 +0200 Subject: [PATCH] feat: getting-started steps for new api-platform CLI installer Replace the gh repo create distribution flow with the new `api-platform` CLI (api-platform/api-platform#2980) on the homepage Getting Started timeline. - Symfony: curl install.sh | sh + api-platform --framework=symfony --with-docker --with-pwa; add PWA frontend block. - Laravel: scaffold via --framework=laravel --with-admin, restructured into Scaffold / Run steps; keep composer require note for existing apps. - PHP: keep composer require api-platform/core, add pointer to the CLI for full Symfony/Laravel apps. Depends on the install.sh script (#674) and a published api-platform CLI release. --- .../components/timeline/TimelineLaravel.tsx | 33 +++++++++---------- .../components/timeline/TimelinePhp.tsx | 11 +++++++ .../components/timeline/TimelineSymfony.tsx | 7 +++- .../timeline/laravel/InstallCode.mdx | 4 ++- .../timeline/laravel/InstallLaravelCode.mdx | 7 ++-- .../components/timeline/symfony/Install.mdx | 9 +++-- .../components/timeline/symfony/Pwa.mdx | 5 +++ 7 files changed, 52 insertions(+), 24 deletions(-) create mode 100644 pwa/app/(common)/components/timeline/symfony/Pwa.mdx diff --git a/pwa/app/(common)/components/timeline/TimelineLaravel.tsx b/pwa/app/(common)/components/timeline/TimelineLaravel.tsx index 6521a6a7e..b2eda68be 100644 --- a/pwa/app/(common)/components/timeline/TimelineLaravel.tsx +++ b/pwa/app/(common)/components/timeline/TimelineLaravel.tsx @@ -16,36 +16,35 @@ export default function TimelineLaravel() { Install the framework

- Installing Laravel + Scaffold a project

- + - API Platform can be installed easily on new and existing Laravel - projects. If you already have an existing project, skip directly to the - next section. + This creates a new Laravel application with API Platform and a + ready-to-use React-admin interface. Already have a project?{" "} + + Add API Platform to an existing Laravel app + {" "} + with{" "} + + composer require api-platform/laravel + + .

- Installing API Platform + Run the app

- +

- In your Laravel project, install the API Platform integration for - Laravel. + Start the Vite dev server and the built-in PHP web server, then open + the admin.

-

- If it's not already done, run{" "} - - php artisan serve - {" "} - to start the built-in web server. -

-

Your development environment is ready!{" "}

diff --git a/pwa/app/(common)/components/timeline/TimelinePhp.tsx b/pwa/app/(common)/components/timeline/TimelinePhp.tsx index 897933299..73f013ec7 100644 --- a/pwa/app/(common)/components/timeline/TimelinePhp.tsx +++ b/pwa/app/(common)/components/timeline/TimelinePhp.tsx @@ -19,6 +19,17 @@ export default function TimelineSymfony() { +

+ Starting a new project? Use the API Platform CLI to scaffold a full{" "} + + Symfony + {" "} + or{" "} + + Laravel + {" "} + application. +

Define the resources diff --git a/pwa/app/(common)/components/timeline/TimelineSymfony.tsx b/pwa/app/(common)/components/timeline/TimelineSymfony.tsx index b98b41425..38730ff4b 100644 --- a/pwa/app/(common)/components/timeline/TimelineSymfony.tsx +++ b/pwa/app/(common)/components/timeline/TimelineSymfony.tsx @@ -1,6 +1,7 @@ "use client"; import InstallCode from "./symfony/Install.mdx"; +import PwaCode from "./symfony/Pwa.mdx"; import ExposeCode from "./symfony/Expose.mdx"; import PlugCode from "./symfony/Plug.mdx"; import NativeCode from "./symfony/Native.mdx"; @@ -15,10 +16,14 @@ export default function TimelineSymfony() {
Install the framework - Install Docker and optionally GitHub CLI. + Install Docker, then scaffold a project with the API Platform CLI. + Start the Next.js Progressive Web App in another terminal: + + +

diff --git a/pwa/app/(common)/components/timeline/laravel/InstallCode.mdx b/pwa/app/(common)/components/timeline/laravel/InstallCode.mdx index 948997943..8975c9042 100644 --- a/pwa/app/(common)/components/timeline/laravel/InstallCode.mdx +++ b/pwa/app/(common)/components/timeline/laravel/InstallCode.mdx @@ -1,3 +1,5 @@ ```bash -composer require api-platform/laravel +npm run dev # in one terminal +php artisan serve # in another +open http://localhost:8000/admin ``` diff --git a/pwa/app/(common)/components/timeline/laravel/InstallLaravelCode.mdx b/pwa/app/(common)/components/timeline/laravel/InstallLaravelCode.mdx index a94d3ddb4..8bcbac480 100644 --- a/pwa/app/(common)/components/timeline/laravel/InstallLaravelCode.mdx +++ b/pwa/app/(common)/components/timeline/laravel/InstallLaravelCode.mdx @@ -1,4 +1,7 @@ ```bash -composer create-project laravel/laravel my-api-platform-laravel-app -cd my-api-platform-laravel-app +# Install the api-platform CLI (detects your OS/arch) +curl -fsSL https://api-platform.com/install.sh | sh +# Scaffold a Laravel project with the React-admin frontend +api-platform my-app --framework=laravel --with-admin +cd my-app ``` diff --git a/pwa/app/(common)/components/timeline/symfony/Install.mdx b/pwa/app/(common)/components/timeline/symfony/Install.mdx index a6300ef52..b4297fd2a 100644 --- a/pwa/app/(common)/components/timeline/symfony/Install.mdx +++ b/pwa/app/(common)/components/timeline/symfony/Install.mdx @@ -1,6 +1,9 @@ ```bash -gh repo create --clone --template api-platform/api-platform my-api --public # or --private -cd my-api -docker compose up +# Install the api-platform CLI (detects your OS/arch) +curl -fsSL https://api-platform.com/install.sh | sh +# Scaffold the project (API + Next.js PWA, Docker) +api-platform my-api --framework=symfony --with-docker --with-pwa +cd my-api/api +docker compose up --wait open https://localhost ``` diff --git a/pwa/app/(common)/components/timeline/symfony/Pwa.mdx b/pwa/app/(common)/components/timeline/symfony/Pwa.mdx new file mode 100644 index 000000000..5bd5dc1b0 --- /dev/null +++ b/pwa/app/(common)/components/timeline/symfony/Pwa.mdx @@ -0,0 +1,5 @@ +```bash +cd ../pwa +pnpm dev +open http://localhost:3000 +```