PHPackages                             getxpos/laravel - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. getxpos/laravel

ActiveLibrary

getxpos/laravel
===============

Laravel SDK for XPOS — instant public URLs with token auth, reserved subdomains, and custom domains

v0.1.0(1mo ago)00MITPHPPHP ^8.1

Since Mar 28Pushed 1mo agoCompare

[ Source](https://github.com/GetXPOS/laravel)[ Packagist](https://packagist.org/packages/getxpos/laravel)[ Docs](https://xpos.dev)[ RSS](/packages/getxpos-laravel/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (3)Versions (2)Used By (0)

XPOS for Laravel
================

[](#xpos-for-laravel)

[![Latest Version on Packagist](https://camo.githubusercontent.com/56f49d7f400fd42fad46da8107dc8a6da3a88cf81b16380a6404a8df13595ca1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f67657478706f732f6c61726176656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/getxpos/laravel)[![Total Downloads](https://camo.githubusercontent.com/bcb7a8c1a98985824ad3d8fd2386a22feece3233317ef7c5549812ab1c8a08bf/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f67657478706f732f6c61726176656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/getxpos/laravel)[![License](https://camo.githubusercontent.com/8143f5c082c65116313889164bda359f36b0456da7c984bfda5b7c38d0a90861/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f67657478706f732f6c61726176656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/getxpos/laravel)

Instant public URLs for Laravel development. Expose your local app with a single command or programmatically from code — supports token auth, reserved subdomains, custom domains, and TCP tunnels.

**[xpos.dev](https://xpos.dev)**

Features
--------

[](#features)

- **One Command** — `php artisan xpos` gets you a public HTTPS URL instantly
- **Programmatic API** — `Xpos::connect(['port' => 8000])` for webhook testing and automated workflows
- **TCP Tunnels** — expose databases, Redis, or any TCP service
- **Token Auth** — longer sessions, reserved subdomains, and custom domains with an XPOS token
- **Reserved Subdomains** — keep `myapp.xpos.to` across sessions (Pro plan)
- **Custom Domains** — use your own domain like `dev.example.com` (Business plan)
- **Auto-Start Server** — starts `php artisan serve` automatically if not running
- **Auto TrustProxies** — HTTPS URLs work correctly out of the box
- **Laravel 10+** — full support

Installation
------------

[](#installation)

```
composer require getxpos/laravel --dev
```

Quick Start
-----------

[](#quick-start)

**CLI:**

```
php artisan xpos
```

**Programmatic:**

```
use GetXPOS\Laravel\Facades\Xpos;

$tunnel = Xpos::connect(['port' => 8000]);
echo $tunnel->url; // https://abc123.xpos.to
$tunnel->close();
```

Authentication
--------------

[](#authentication)

For longer sessions and more features, add your XPOS token to `.env`:

```
XPOS_TOKEN=tk_your_token_here
```

Get your token at [xpos.dev/dashboard/tokens](https://xpos.dev/dashboard/tokens).

CLI Usage
---------

[](#cli-usage)

```
# Anonymous tunnel (random subdomain, 3hr expiry)
php artisan xpos

# Authenticated tunnel (uses XPOS_TOKEN from .env)
php artisan xpos

# Reserved subdomain (Pro plan)
php artisan xpos --subdomain=myapp

# Custom domain (Business plan)
php artisan xpos --domain=dev.example.com

# Override token from command line
php artisan xpos --token=tk_your_token

# Use a specific port
php artisan xpos --port=8080

# Use an existing server (skip starting artisan serve)
php artisan xpos --no-serve --port=3000

# Bind to a specific host
php artisan xpos --host=0.0.0.0

# TCP tunnel (database, Redis, etc.)
php artisan xpos --mode=tcp --port=5432 --token=tk_xxx
```

Programmatic API
----------------

[](#programmatic-api)

Create tunnels from your PHP code — useful for webhook testing, integration tests, and automated workflows.

### Basic Usage

[](#basic-usage)

```
use GetXPOS\Laravel\Facades\Xpos;

$tunnel = Xpos::connect(['port' => 8000]);

echo $tunnel->url;       // https://abc123.xpos.to
echo $tunnel->expiresAt; // 2026-03-28T10:30:45Z

$tunnel->close();
```

### With Options

[](#with-options)

```
$tunnel = Xpos::connect([
    'port' => 8000,
    'token' => 'tk_your_token',
    'subdomain' => 'myapp',
]);
// https://myapp.xpos.to
```

### Without Facade

[](#without-facade)

```
use GetXPOS\Laravel\XposTunnel;

$tunnel = XposTunnel::connect(['port' => 8000]);
echo $tunnel->url;
$tunnel->close();
```

### Webhook Testing

[](#webhook-testing)

```
use GetXPOS\Laravel\Facades\Xpos;

// In your test setup
$tunnel = Xpos::connect(['port' => 8000, 'token' => 'tk_xxx']);

// Configure Stripe to send webhooks to your tunnel
$stripe = new \Stripe\StripeClient('sk_test_xxx');
$stripe->webhookEndpoints->create([
    'url' => $tunnel->url . '/api/webhooks/stripe',
    'enabled_events' => ['payment_intent.succeeded'],
]);

// Run your tests...

$tunnel->close();
```

### Callbacks

[](#callbacks)

```
use GetXPOS\Laravel\XposTunnel;

$tunnel = new XposTunnel(['port' => 8000]);

$tunnel->onConnect(function (array $info) {
    echo "Connected: {$info['url']}\n";
    // $info['expiresAt'] may be null for paid plans
});

$tunnel->onClose(function (?int $exitCode) {
    echo "Tunnel closed (exit: {$exitCode})\n";
});

$tunnel->onOutput(function (string $data) {
    // Raw SSH output
});

$tunnel->start();

// Block until process exits
$tunnel->wait();
```

> **Note:** `onClose` fires during `wait()` or `close()` — PHP runs synchronously, so there is no background event loop.

TCP Tunnels
-----------

[](#tcp-tunnels)

Expose any TCP service (databases, Redis, message queues, etc.).

### CLI

[](#cli)

```
# Expose PostgreSQL
php artisan xpos --mode=tcp --port=5432 --token=tk_xxx

# Expose Redis
php artisan xpos --mode=tcp --port=6379 --token=tk_xxx

# Expose MySQL
php artisan xpos --mode=tcp --port=3306 --token=tk_xxx
```

### Programmatic

[](#programmatic)

```
use GetXPOS\Laravel\Facades\Xpos;

$tunnel = Xpos::connect([
    'mode' => 'tcp',
    'port' => 5432,
    'token' => 'tk_xxx',
]);

echo $tunnel->url; // 203.0.113.5:34567 (ip:port)

$tunnel->close();
```

> **Note:** TCP tunnels require authentication (a token). The tunnel URL is an `ip:port` pair instead of an HTTPS URL.

Configuration
-------------

[](#configuration)

Publish the config file:

```
php artisan vendor:publish --tag=xpos-config
```

Options in `config/xpos.php`:

KeyDefaultDescription`token``env('XPOS_TOKEN')`Auth token from xpos.dev dashboard`server``go.xpos.dev`XPOS tunnel server`ssh_port``443`SSH port`default_port``8000`Default dev server port`trust_proxies``true`Auto-configure TrustProxies for HTTPSHTTPS &amp; TrustProxies
------------------------

[](#https--trustproxies)

The package automatically configures Laravel's TrustProxies middleware so `asset()`, `url()`, `route()`, and other helpers generate correct HTTPS URLs when accessed through an XPOS tunnel.

This works with `*.xpos.to` subdomains, custom domains, and any future tunnel domains. Disable with `XPOS_TRUST_PROXIES=false` in `.env` if needed.

Requirements
------------

[](#requirements)

- PHP 8.1+
- Laravel 10+
- SSH client in PATH

Troubleshooting
---------------

[](#troubleshooting)

**Port already in use?**

```
php artisan xpos --port=8001
```

**SSH connection issues?**

- Ensure SSH client is installed and in PATH
- Check firewall settings for port 443

**HTTPS URLs not working?**

- Ensure `trust_proxies` is `true` in `config/xpos.php`
- Clear config cache: `php artisan config:clear`

**Reserved subdomain not working?**

- Ensure `XPOS_TOKEN` is set in `.env`
- Verify your plan supports reserved subdomains at [xpos.dev](https://xpos.dev)

**TCP mode requires --port?**

- TCP mode doesn't auto-start `artisan serve` — you must specify the port of the service you're exposing: `--mode=tcp --port=5432`

**TCP tunnel shows "authentication required"?**

- TCP tunnels require a token. Set `XPOS_TOKEN` in `.env` or pass `--token=tk_xxx`

.gitignore
----------

[](#gitignore)

Add `.xpos.pid` to your project's `.gitignore`:

```
.xpos.pid

```

Links
-----

[](#links)

- **Website**: [xpos.dev](https://xpos.dev)
- **Dashboard**: [xpos.dev/dashboard](https://xpos.dev/dashboard)
- **GitHub**: [github.com/getxpos/laravel](https://github.com/getxpos/laravel)

License
-------

[](#license)

MIT License. See [LICENSE](LICENSE) for details.

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance91

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity32

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

45d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b931389048e1a402acdf133cef6a4a6f1c89da59c84dc649b7ba5463533f5223?d=identicon)[VishnuSivadasVS](/maintainers/VishnuSivadasVS)

---

Top Contributors

[![VishnuSivadasVS](https://avatars.githubusercontent.com/u/34345124?v=4)](https://github.com/VishnuSivadasVS "VishnuSivadasVS (5 commits)")

---

Tags

laravelsshdevelopmentsharetunnelngroklocalhostxpospublic-url

### Embed Badge

![Health badge](/badges/getxpos-laravel/health.svg)

```
[![Health](https://phpackages.com/badges/getxpos-laravel/health.svg)](https://phpackages.com/packages/getxpos-laravel)
```

###  Alternatives

[laravel/dusk

Laravel Dusk provides simple end-to-end testing and browser automation.

1.9k36.7M259](/packages/laravel-dusk)[laravel/envoy

Elegant SSH tasks for PHP.

1.6k5.5M18](/packages/laravel-envoy)[spatie/laravel-health

Monitor the health of a Laravel application

85810.0M83](/packages/spatie-laravel-health)[laravel/jetstream

Tailwind scaffolding for the Laravel framework.

4.1k19.8M136](/packages/laravel-jetstream)[wnx/laravel-stats

Get insights about your Laravel Project

1.8k1.8M7](/packages/wnx-laravel-stats)[tightenco/jigsaw

Simple static sites with Laravel's Blade.

2.2k438.5k29](/packages/tightenco-jigsaw)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
