Download the PHP package elliottlawson/daytona-php-sdk without Composer
On this page you can find all versions of the php package elliottlawson/daytona-php-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download elliottlawson/daytona-php-sdk
More information about elliottlawson/daytona-php-sdk
Files in elliottlawson/daytona-php-sdk
Package daytona-php-sdk
Short Description PHP SDK for Daytona API integration
License MIT
Informations about the package daytona-php-sdk
Daytona PHP SDK
A PHP SDK for interacting with the Daytona API to manage development sandboxes.
Requirements
- PHP 8.2 or higher
- Laravel 10.x, 11.x, or 12.x (optional, for Laravel integration)
Installation
Configuration
Laravel Applications
-
The service provider will be automatically registered via Laravel's package discovery.
-
Publish the configuration file:
- Add your Daytona credentials to your
.env
file:
Configuration Options
The SDK requires three configuration values:
apiUrl
(string): The Daytona API endpoint (defaults tohttps://api.daytona.io
)apiKey
(string, required): Your Daytona API authentication keyorganizationId
(string, required): Your organization ID
Type-Safe Configuration
For better type safety and IDE support, you can use the Config
class:
Non-Laravel Applications
You can instantiate the client directly with configuration:
Usage
Using the Facade (Laravel)
The easiest way to use Daytona in Laravel is through the facade:
Creating a Client
In Laravel (Recommended)
Manual Configuration
Managing Sandboxes
Create a Sandbox
Get Sandbox Information
Start/Stop Sandbox
Working with Files
Using the Sandbox Object (Recommended)
Executing Commands
Git Operations
Using the Sandbox Object (Recommended)
Using the Client Directly
Complete Example
Using the Facade
Using Dependency Injection
Advanced Usage
Working with Sandbox Data
State Management
Error Handling
The SDK provides specific exception types for different error scenarios:
Exception Types:
ConfigurationException
- Missing API keys, invalid configurationSandboxException
- Sandbox creation, state transitions, lifecycle errorsFileSystemException
- File read/write/delete operationsCommandExecutionException
- Command execution failuresGitException
- Git operations (clone, commit, push, etc.)ApiException
- HTTP API errors with status codes and responses
All exceptions extend the base ElliottLawson\Daytona\Exception
class.
echo $commit->hash . ' - ' . $commit->message . PHP_EOL;
echo 'Author: ' . $commit->author . PHP_EOL;
echo 'Date: ' . $commit->date . PHP_EOL;
}
bash
./vendor/bin/pest
## Error Handling
All SDK methods throw `Exception` on errors:
## License
MIT
All versions of daytona-php-sdk with dependencies
guzzlehttp/guzzle Version ^7.5
illuminate/support Version ^10.0|^11.0|^12.0