DOCUMENTATION / GETTING STARTED

From your first push
to your next idea.

Connect your tools, push your code, and deploy a function.

Create an account
01

Get an access token

Create an account, then create an access token. Git uses your token in place of your account password.

Keep your token handyYou’ll paste it when Git asks for a password in the next step.

02

Push your first repository

In your local repository, add your remote and push the main branch. Pushing to a new repository name creates it automatically.

Terminal
git remote add origin https://git.laravel.cloud/<username>/my-app.git
git push -u origin main

When prompted, enter your username and paste the token as your password. Repositories are private: only you and admins can see them.

03

Deploy a function Optional

Prefer to start in the browser?Create a function in JavaScript / TypeScript or PHP. It deploys straight away and opens in the editor. Each save commits and redeploys your changes. You can also open any repository you own with “Edit in the browser.”

JavaScript and TypeScript

A JavaScript / TypeScript repository with a package.json is built and deployed on every push. Export a fetch handler that takes a Request and returns a Response.

package.json
{ "name": "my-app", "main": "src/index.ts" }
src/index.ts TypeScript
export default {
  async fetch(request: Request): Promise<Response> {
    const url = new URL(request.url);
    if (url.pathname === "/api/hello") {
      return Response.json({ hello: url.searchParams.get("name") ?? "world" });
    }
    return new Response("<h1>It works</h1>", { headers: { "content-type": "text/html" } });
  },
};

Your function is publicly available at https://<repo>--<username>.fn.reaz.io/. Try the example with:

Terminal
curl https://my-app--<username>.fn.reaz.io/api/hello?name=Ada

Your repository page shows the live URL, build history, and build errors. A failed build leaves the previous version live.

Available in JavaScript / TypeScript

TypeScript, imports between your files, Request, Response, Headers, URL, setTimeout, and console.log.

Not supported yet

Node built-ins such as fs and http (including Express), outbound fetch, npm packages that aren’t committed, and state between requests.

Each request gets 10 seconds, 128 MB of memory, and a 1 MB body. The JavaScript / TypeScript entry file is main from package.json, otherwise src/index.ts, index.ts, or their .js versions.

PHP functions

Start with an index.php file. Every request runs that file in an isolated PHP runtime, and its output becomes the response. No package.json is needed.

index.php PHP
<?php
$path = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);

if ($path === '/api/hello') {
    header('Content-Type: application/json');
    echo json_encode(['hello' => $_GET['name'] ?? 'world']);
    return;
}

header('Content-Type: text/html; charset=utf-8');
echo '<h1>It works</h1>';

Read query parameters with $_GET, form fields with $_POST, and the request method and path with $_SERVER. Use file_get_contents('php://input') for a raw request body, such as JSON. Set headers with header() and the response status with http_response_code().

Available in PHP

PHP request handling, JSON responses, and include / require for files committed to your repository. Repository files are available read-only. Each request starts fresh.

Keep it lightweight

Outbound network requests, operating-system processes, Composer installation, and persistent file storage are unavailable. This runtime is intended for small PHP functions.

PHP entry files are checked in this order: index.php, public/index.php, then src/index.php. In a repository with both PHP and package.json, add composer.json to select PHP. Composer dependencies are not installed during a build.

If something goes wrong

A few common messages, and how to get moving again.

The messageWhat to do
Authentication failedUse a token instead of your password. If it expired, create a new one. If Git doesn’t ask again, run:
printf "url=https://git.laravel.cloud\n\n" | git credential reject
Your account isn't approved for pushing yetAsk an admin to approve your account.
… does not have access to …You can only push to https://git.laravel.cloud/<username>/….
No app is deployed here.Check the URL and confirm that the repository’s latest build succeeded.
the app must export a fetch handlerExport default { fetch(request) { … } } from the entry file.