2wee / laravel
Laravel SDK for the 2wee terminal UI protocol
dev-main
2026-03-22 15:19 UTC
Requires
- php: ^8.2
- illuminate/support: ^11.0|^12.0
Requires (Dev)
- orchestra/testbench: ^9.0|^10.0
- phpunit/phpunit: ^11.0
This package is auto-updated.
Last update: 2026-03-22 15:19:59 UTC
README
A Laravel plugin that exposes your application's data to 2Wee TUI clients. Define resources — each one maps an Eloquent model to a set of screens — and the plugin handles routing, authentication, and the protocol.
Installation
composer require 2wee/laravel php artisan 2wee:install php artisan migrate
Create a resource
php artisan 2wee:resource CustomerResource --model=Customer
Edit the generated file in app/TwoWee/Resources/CustomerResource.php to define your fields and columns, then connect any 2Wee client to:
https://your-app.example.com/terminal
Web terminal (optional)
Embed a browser-based terminal directly in your app — no client installation required:
php artisan 2wee:install-terminal php artisan 2wee:start-terminal
Add to any Blade view:
<x-2wee::terminal />
Set TWOWEE_QUIT_URL in your .env to redirect users when they exit the terminal:
TWOWEE_QUIT_URL=https://your-app.example.com
Artisan commands
| Command | Description |
|---|---|
2wee:install |
Publish config and scaffold resources directory |
2wee:resource |
Generate a new resource class |
2wee:lookup |
Generate a reusable lookup class |
2wee:action |
Generate a screen action class |
2wee:install-terminal |
Download web terminal binaries |
2wee:start-terminal |
Start the web terminal service |
2wee:stop-terminal |
Stop the web terminal service |
2wee:check-terminal |
Show terminal service status |
Documentation
Full documentation at 2wee.dev.