Download the PHP package halilcosdu/laravel-replicate without Composer
On this page you can find all versions of the php package halilcosdu/laravel-replicate. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download halilcosdu/laravel-replicate
More information about halilcosdu/laravel-replicate
Files in halilcosdu/laravel-replicate
Package laravel-replicate
Short Description Laravel client for Replicate predictions, files, models, trainings, and signed webhooks
License MIT
Homepage https://github.com/halilcosdu/laravel-replicate
Informations about the package laravel-replicate
Laravel Replicate
A Laravel-native client for the Replicate HTTP API. Run community, official, and deployment models; manage models and trainings; upload files; and authenticate incoming webhooks using Laravel's familiar HTTP client and facade APIs.
Highlights
- Laravel 11, 12, and 13 support, including PHP 8.5 on supported framework versions.
- Predictions for community models, official models, and deployments.
- Sync mode, prediction deadlines, filters, and cursor pagination.
- Multipart uploads and resource management through Replicate's Files API.
- HMAC-SHA256 webhook verification with timestamp and key-rotation support.
- Native
Illuminate\Http\Client\Responseresults with accurate IDE return types. - Hermetic HTTP tests, PHPStan analysis, and a full version matrix in CI.
Requirements
| Laravel | Supported PHP versions | Framework status in 2026 |
|---|---|---|
| 11.x | 8.2–8.4 | Legacy compatibility; EOL |
| 12.x | 8.2–8.5 | Security-supported |
| 13.x | 8.3–8.5 | Actively supported |
The matrix follows Laravel's official support policy. The package requires PHP ^8.2; PHP 8.5 is tested with Laravel 12 and 13. Laravel 11 is not paired with PHP 8.5 because that combination is not supported by the framework itself.
Laravel 11 reached end-of-life on March 12, 2026 and currently has upstream security advisories. Compatibility remains available for migration windows because it is an explicit target of this package, but new and internet-facing applications should use Laravel 12 or 13. Composer may report or block affected Laravel 11 dependency resolutions; do not suppress that warning in production without reviewing the advisories.
Installation
Install the package with Composer:
Laravel discovers the service provider and facade automatically. Publish the configuration only when you need to customize it:
Add your Replicate API token to .env:
The published configuration contains:
Quick start
All API methods return Laravel's HTTP client Response, so throw(), json(), collect(), successful(), and the other standard response helpers are available.
Run a versioned community model through the generic predictions endpoint:
Sync mode and deadlines
Prediction creation methods accept optional request headers. Prefer controls how long the HTTP request waits; Cancel-After controls the prediction's lifetime.
A sync request may still return starting or processing when the wait period expires. Retrieve its latest state with:
Pagination and filters
List methods accept an optional query array and pass it directly to Replicate:
This is supported by listCollections, listDeployments, listFiles, listModels, listModelExamples, listPredictions, and listTrainings.
Files API
Upload a string or readable PHP stream as multipart content. Metadata is encoded as a JSON multipart field.
Manage uploaded resources with listFiles(), getFile($id), deleteFile($id), and downloadFile($id, $owner, $expiry, $signature).
Webhook verification
Never trust a webhook payload before verifying its signature. First retrieve your signing secret once, then store it securely rather than requesting it for every delivery:
Verify the untouched Laravel request before processing its JSON body:
verifyWebhook() validates the webhook-id, webhook-timestamp, and every v1 candidate in webhook-signature using constant-time comparison. Requests outside the configured 300-second tolerance are rejected to reduce replay risk. You may override the secret and tolerance for a specific request:
Remember to exempt the webhook route from CSRF protection and make processing idempotent because Replicate may retry a delivery.
API reference
Account, discovery, and hardware
Collections
Deployments
Files
Models and versions
Predictions
The legacy createModelPrediction($owner, $name, $version, $data, $headers) method remains available for backward compatibility. Replicate's official-model endpoint does not accept a version path parameter, so new code should use createOfficialModelPrediction().
Trainings
Webhooks
Error handling
The client does not hide API failures. Use Laravel's standard response helpers according to your application's needs:
See Laravel's HTTP client documentation for response inspection, retries, exceptions, and test fakes.
Testing and quality
The GitHub Actions matrix covers supported Laravel 11–13 and PHP 8.2–8.5 combinations with both lowest and stable dependency sets.
Changelog
See CHANGELOG.md for release notes.
Security
Please follow SECURITY.md to report vulnerabilities privately.
Credits
License
Laravel Replicate is open-source software licensed under the MIT license.
All versions of laravel-replicate with dependencies
illuminate/contracts Version ^11.0||^12.0||^13.0
illuminate/http Version ^11.0||^12.0||^13.0
illuminate/support Version ^11.0||^12.0||^13.0
spatie/laravel-package-tools Version ^1.16