# Share a local Laravel app

Expose is built into [Laravel Herd](https://expose.dev/docs/integrations/laravel-herd) and works with Valet, Sail and `php artisan serve`. It shares your site with a public HTTPS URL and takes care of Vite's dev server for you.

## Herd and Valet

Go to your project directory and run:

```bash
expose
```

Expose shares `foldername.test`. To share a specific site, name it:

```bash
expose share my-app.test
```

## artisan serve and Sail

Share the port your app listens on:

```bash
# php artisan serve
expose share http://localhost:8000

# Laravel Sail
expose share http://localhost:80
```

## Vite assets and hot reloading

If `npm run dev` is running, Expose detects the Vite process, shares it as well and rewrites the page to use it. Your CSS, JavaScript and hot reloading work through the tunnel without changing `vite.config.js`.

## Generate HTTPS URLs behind the tunnel

Visitors reach your app over HTTPS, while Expose talks to your local site. If Laravel generates `http://` links or mixed-content assets, trust the proxy so it reads the forwarded scheme and host. In `bootstrap/app.php`:

```php
->withMiddleware(function (Middleware $middleware) {
    $middleware->trustProxies(at: '*');
})
```

Only do this in your local environment.

## Webhooks

Use the public URL as the endpoint at your provider, for example for Laravel Cashier at `/stripe/webhook` or `/paddle/webhook`, and exclude that route from CSRF protection as the package's documentation describes. The Expose dashboard at `http://127.0.0.1:4040` shows each webhook and can replay it. See [Stripe webhooks](https://expose.dev/docs/guides/stripe-webhooks).

## Keep the settings in the project

An [`expose.yaml`](https://expose.dev/docs/advanced-usage/expose-yaml) file in the project stores the subdomain, server and other options, so the whole team shares the site the same way with a plain `expose`.
