- Installing Laravel + Scaffold a project
-
+ 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. +
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 +```