diff --git a/pwa/app/(common)/components/timeline/TimelineLaravel.tsx b/pwa/app/(common)/components/timeline/TimelineLaravel.tsx index 6521a6a7..b2eda68b 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 89793329..73f013ec 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 b98b4142..38730ff4 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 94899794..8975c904 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 a94d3ddb..8bcbac48 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 a6300ef5..b4297fd2 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 00000000..5bd5dc1b --- /dev/null +++ b/pwa/app/(common)/components/timeline/symfony/Pwa.mdx @@ -0,0 +1,5 @@ +```bash +cd ../pwa +pnpm dev +open http://localhost:3000 +```