> ## Documentation Index
> Fetch the complete documentation index at: https://vexidata.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Laravel Cloud

> Connect your Laravel Cloud managed database to VexiData.

Laravel Cloud supports two database types:

<CardGroup cols={2}>
  <Card title="PostgreSQL Serverless" icon="leaf">
    Powered by Neon. Autoscaling, serverless PostgreSQL with pgbouncer connection pooling. Recommended for most projects.
  </Card>

  <Card title="MySQL" icon="database">
    Traditional managed MySQL with autoscaling compute and storage. Requires enabling public endpoint for external access.
  </Card>
</CardGroup>

## Prerequisites

* A [Laravel Cloud](https://cloud.laravel.com) account with a database resource created
* A [VexiData](https://vexidata.com) account

## Connect Laravel Cloud to VexiData

<Steps>
  <Step title="Get your database credentials">
    1. Log in to your [Laravel Cloud Dashboard](https://cloud.laravel.com)
    2. Navigate to your **Organization** > **Resources** > **Databases**
    3. Click the **...** menu next to your database
    4. Select **View credentials**

    You'll see the connection details including host, port, username, password, and database name.
  </Step>

  <Step title="Enable public endpoint (MySQL only)">
    PostgreSQL Serverless databases are publicly accessible by default. For **MySQL** databases, you need to enable external access first:

    1. Click the **...** menu next to your MySQL database
    2. Select **Edit settings**
    3. Toggle **Enable public endpoint** on
    4. Save your changes

    <Info>
      If you're connecting a PostgreSQL Serverless database, skip this step — it's already accessible externally.
    </Info>
  </Step>

  <Step title="Choose your connection endpoint (PostgreSQL only)">
    Laravel Cloud PostgreSQL provides two connection endpoints:

    |                     | Pooler Endpoint                              | Standard Endpoint                     |
    | ------------------- | -------------------------------------------- | ------------------------------------- |
    | **Host**            | `ep-[name]-pooler.[region].pg.laravel.cloud` | `ep-[name].[region].pg.laravel.cloud` |
    | **Port**            | `5432`                                       | `5432`                                |
    | **Best for**        | Short-lived, on-demand connections           | Persistent, long-running connections  |
    | **How to identify** | Host contains `-pooler`                      | Host does not contain `-pooler`       |

    To get the pooler endpoint, append `-pooler` to the first segment of the hostname:

    ```
    Standard:  ep-frosty-shadow-a57j6ubb.us-east-2.pg.laravel.cloud
    Pooler:    ep-frosty-shadow-a57j6ubb-pooler.us-east-2.pg.laravel.cloud
    ```

    <Tip>
      For VexiData, we recommend the **Pooler Endpoint**. VexiData connects on-demand when running queries, so the pooler (pgbouncer) provides better performance and handles connection limits more efficiently.
    </Tip>
  </Step>

  <Step title="Add the connection in VexiData">
    1. Go to [Data Sources](https://vexidata.com/data-sources) in VexiData
    2. Click **PostgreSQL** or **MySQL** depending on your database type
    3. Fill in the details from your Laravel Cloud credentials:

    **For PostgreSQL Serverless:**

    | Field            | Value                                                                 |
    | ---------------- | --------------------------------------------------------------------- |
    | **Display Name** | A name to identify this connection (e.g., "Laravel Cloud Production") |
    | **Host**         | `ep-[name]-pooler.[region].pg.laravel.cloud`                          |
    | **Port**         | `5432`                                                                |
    | **Database**     | Your database name                                                    |
    | **Schema**       | `public` (default — change if your tables are in a different schema)  |
    | **Username**     | Your database username                                                |
    | **Password**     | Your database password                                                |

    **For MySQL:**

    | Field            | Value                                                                 |
    | ---------------- | --------------------------------------------------------------------- |
    | **Display Name** | A name to identify this connection (e.g., "Laravel Cloud Production") |
    | **Host**         | Your MySQL hostname from credentials                                  |
    | **Port**         | `3306`                                                                |
    | **Database**     | Your database name                                                    |
    | **Username**     | Your database username                                                |
    | **Password**     | Your database password                                                |
  </Step>

  <Step title="Test and save">
    Click **Test & Save Connection**. VexiData will verify it can reach your database. Once connected, your schema will be analyzed automatically.
  </Step>
</Steps>

## Troubleshooting

<AccordionGroup>
  <Accordion title="Connection timed out">
    * **MySQL:** Make sure you've enabled the **public endpoint** in your database settings. This is disabled by default
    * **PostgreSQL:** Serverless databases hibernate when idle. The first connection after hibernation may take a few seconds — try again if it times out
    * Verify that the host and port are correct in your VexiData connection form
  </Accordion>

  <Accordion title="Authentication failed">
    * Double-check your credentials by viewing them again in Laravel Cloud (**Resources** > **Databases** > **...** > **View credentials**)
    * Make sure you're not using the auto-injected environment variables (e.g., `DB_HOST`) — these are for apps running *on* Laravel Cloud, not for external connections. Use the credentials from the **View credentials** dialog
  </Accordion>

  <Accordion title="No tables visible after connecting">
    * Confirm your tables are in the `public` schema (PostgreSQL) or the correct database (MySQL). If they're in a custom schema, update the **Schema** field in VexiData
    * Check that your database user has `SELECT` permissions on the tables you want to query
  </Accordion>

  <Accordion title="PostgreSQL: Too many connections">
    * Switch to the **pooler endpoint** by adding `-pooler` to the first segment of your hostname. The pooler supports up to 10,000 concurrent connections via pgbouncer
  </Accordion>
</AccordionGroup>
