Download the PHP package darknautica/volta-php without Composer
On this page you can find all versions of the php package darknautica/volta-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download darknautica/volta-php
More information about darknautica/volta-php
Files in darknautica/volta-php
Download darknautica/volta-php
More information about darknautica/volta-php
Files in darknautica/volta-php
Vendor darknautica
Package volta-php
Short Description The official Laravel SDK for Volta — AI billing, handled.
License MIT
Homepage https://github.com/DarkNautica/volta-php
Package volta-php
Short Description The official Laravel SDK for Volta — AI billing, handled.
License MIT
Homepage https://github.com/DarkNautica/volta-php
Please rate this library. Is it a good library?
Informations about the package volta-php
volta-php
The official Laravel SDK for Volta — AI billing, handled.
Requirements
- PHP 8.2+
- Laravel 10, 11, or 12
Installation
Publish the config:
Add to your .env:
Quick Start
Three lines to add billing to any AI endpoint:
Middleware
Protect entire routes automatically:
The middleware resolves the user automatically:
$request->volta_user_idif set explicitly$request->user()->idif authenticated- Falls back to request IP for anonymous users
Blade Directives
Available Methods
| Method | Description |
|---|---|
Volta::charge($userId, $credits, $model?) |
Deduct credits. Throws on failure. |
Volta::hasAccess($userId, $credits?) |
Check access. Always returns bool. |
Volta::balance($userId) |
Get credit balance. |
Volta::topUp($userId, $credits) |
Add credits to a user. |
Volta::usage($userId) |
Get usage history array. |
Volta::portalUrl($userId, $options?) |
Get signed billing portal URL. |
Testing Connection
This will verify your API key, test connectivity, and display account info.
Error Handling
Fail Silently Mode
Set VOLTA_FAIL_SILENTLY=true in .env to prevent Volta errors from crashing your app. When enabled:
hasAccess()returnsfalsebalance()returns0charge()returnsfalse
This is useful for apps that should degrade gracefully if Volta is unreachable.
Configuration
| Env Variable | Default | Description |
|---|---|---|
VOLTA_APP_KEY |
(required) | Your Volta API key |
VOLTA_BASE_URL |
https://volta.test |
Volta API base URL |
VOLTA_TIMEOUT |
10 |
HTTP timeout in seconds |
VOLTA_FAIL_SILENTLY |
false |
Suppress exceptions, return safe defaults |
VOLTA_CACHE_TTL |
30 |
Balance cache duration in seconds (0 to disable) |
License
MIT
All versions of volta-php with dependencies
PHP Build Version
Package Version
Requires
php Version
^8.2
illuminate/support Version ^10.0|^11.0|^12.0|^13.0
guzzlehttp/guzzle Version ^7.0
illuminate/support Version ^10.0|^11.0|^12.0|^13.0
guzzlehttp/guzzle Version ^7.0
The package darknautica/volta-php contains the following files
Loading the files please wait ...