zeevx / laravel-brimble-sandbox
Laravel integration for the Brimble Sandbox PHP SDK: config, container binding, facade, and Artisan commands.
Requires
- php: ^8.2
- illuminate/console: ^11.0 || ^12.0 || ^13.0
- illuminate/contracts: ^11.0 || ^12.0 || ^13.0
- illuminate/support: ^11.0 || ^12.0 || ^13.0
- zeevx/php-brimble-sandbox: ^0.1
Requires (Dev)
- larastan/larastan: ^3.0
- laravel/pint: ^1.18
- orchestra/testbench: ^10.0 || ^11.0
- pestphp/pest: ^3.5 || ^4.0
README
Laravel integration for zeevx/php-brimble-sandbox: a config file, a container binding, a facade, and Artisan commands. All the API logic lives in the core package; this is the glue.
Install
composer require zeevx/laravel-brimble-sandbox
The service provider and BrimbleSandbox facade are auto-discovered. Publish the config if you want to tweak defaults:
php artisan vendor:publish --tag=brimble-sandbox-config
Configure
Set your key in .env:
BRIMBLE_SANDBOX_KEY=your-api-key
Optional overrides (shown with defaults):
BRIMBLE_SANDBOX_BASE_URL=https://sandbox.brimble.io BRIMBLE_SANDBOX_TIMEOUT=90 BRIMBLE_SANDBOX_MAX_RETRIES=2
Usage
Resolve the client from the container, inject it, or use the facade. All three give you the same configured Zeevx\BrimbleSandbox\Sandbox instance.
use Zeevx\LaravelBrimbleSandbox\Facades\BrimbleSandbox; use Zeevx\BrimbleSandbox\Requests\CreateSandbox; use Zeevx\BrimbleSandbox\Requests\ExecInput; $sb = BrimbleSandbox::sandboxes()->create(new CreateSandbox(template: 'node-22')); echo $sb->exec(new ExecInput('node -v'))->stdout; $sb->destroy();
Dependency injection:
use Zeevx\BrimbleSandbox\Sandbox; public function __construct(private readonly Sandbox $brimble) {}
See the core package README for the full API (exec/code, streaming, files, snapshots, volumes, pagination, error handling).
Artisan commands
# List your sandboxes php artisan brimble:sandbox:list --page=1 --limit=15 # Run a shell command inside a sandbox (add --stream for live output) php artisan brimble:sandbox:exec {id} "npm test" --stream # Destroy a sandbox (add --force to skip the prompt) php artisan brimble:sandbox:destroy {id}
Development
composer test # Pest + Testbench composer lint # Pint composer analyse # PHPStan (Larastan)
License
MIT