PHPackages                             halilcosdu/laravel-replicate - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. halilcosdu/laravel-replicate

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

halilcosdu/laravel-replicate
============================

Replicate Laravel PHP client

v1.1.0(5mo ago)548.1k↓18.6%5[1 issues](https://github.com/halilcosdu/laravel-replicate/issues)[3 PRs](https://github.com/halilcosdu/laravel-replicate/pulls)MITPHPPHP ^8.2CI passing

Since Apr 27Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/halilcosdu/laravel-replicate)[ Packagist](https://packagist.org/packages/halilcosdu/laravel-replicate)[ Docs](https://github.com/halilcosdu/laravel-replicate)[ Fund](https://www.buymeacoffee.com/halilcosdu5)[ RSS](/packages/halilcosdu-laravel-replicate/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (13)Versions (9)Used By (0)

Replicate Laravel PHP client
============================

[](#replicate-laravel-php-client)

[![Latest Version on Packagist](https://camo.githubusercontent.com/eb8211f78fe8200e41b394c9e9498468d63e0d8a98d358e952e55218e4a8e3d9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f68616c696c636f7364752f6c61726176656c2d7265706c69636174652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/halilcosdu/laravel-replicate)[![GitHub Tests Action Status](https://camo.githubusercontent.com/2de397c102856adc74698ede661584ff00882af9e6693729d58ee36f7d5b5e0b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f68616c696c636f7364752f6c61726176656c2d7265706c69636174652f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/halilcosdu/laravel-replicate/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/e74f457f424703043f5aae033c8543f8742d97929f53edb3516b9a14611c4176/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f68616c696c636f7364752f6c61726176656c2d7265706c69636174652f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/halilcosdu/laravel-replicate/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/e2fff2e565e376628b4b73567933ca068bba177e124de62788fa148cfe365762/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f68616c696c636f7364752f6c61726176656c2d7265706c69636174652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/halilcosdu/laravel-replicate)

The halilcosdu/laravel-replicate package is a Laravel client for the Replicate API. It provides a convenient way to interact with the Replicate API using PHP and Laravel's Facade pattern. The package includes methods for managing and interacting with various aspects of the Replicate service, such as accounts, collections, deployments, hardware, models, predictions, and trainings. For example, you can list all collections, get a specific collection, create a new deployment, get or update an existing deployment, list all hardware, create a new model, get a specific model or its version, list all versions of a model, delete a model version, list all models, create a prediction, get or cancel a prediction, list all predictions, list all trainings, create a new training, get or cancel a training, get the default secret, and create a deployment or model prediction. The package is configurable via Laravel's configuration system, allowing you to set your API token and URL through your environment file.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require halilcosdu/laravel-replicate
```

You can publish the config file with:

```
php artisan vendor:publish --tag="replicate-config"
```

This is the contents of the published config file:

```
return [
    'api_token' => env('REPLICATE_API_TOKEN'),
    'api_url' => env('REPLICATE_API_URL', 'https://api.replicate.com/v1'),
];
```

Usage
-----

[](#usage)

```
Replicate::account()
Replicate::getCollection(string $slug)
Replicate::listCollections()
Replicate::listDeployments()
Replicate::createDeployment(array $data)
Replicate::getDeployment(string $owner, string $name)
Replicate::updateDeployment(string $owner, string $name, array $data)
Replicate::listHardware()
Replicate::createModel(array $data)
Replicate::getModel(string $owner, string $name)
Replicate::getModelVersion(string $owner, string $name, string $version)
Replicate::listModelVersions(string $owner, string $name)
Replicate::deleteModelVersion(string $owner, string $name, string $version)
Replicate::listModels()
Replicate::createPrediction(array $data)
Replicate::getPrediction(string $id)
Replicate::cancelPrediction($id)
Replicate::listPredictions()
Replicate::listTrainings()
Replicate::createTraining(string $owner, string $name, string $version, array $data)
Replicate::getTraining(string $id)
Replicate::cancelTraining($id)
Replicate::defaultSecret()
Replicate::createDeploymentPrediction(string $owner, string $name, array $data)
Replicate::createModelPrediction(string $owner, string $name, string $version, array $data)
```

#### Reference:

[](#reference-httpsreplicatecomdocsreferencehttp)

Example
-------

[](#example)

```
use HalilCosdu\Replicate\Facades\Replicate;

$response = Replicate::account();
```

```
$response->body() : string;
$response->json($key = null, $default = null) : mixed;
$response->object() : object;
$response->collect($key = null) : Illuminate\Support\Collection;
$response->status() : int;
$response->successful() : bool;
$response->redirect(): bool;
$response->failed() : bool;
$response->clientError() : bool;
$response->header($header) : string;
$response->headers() : array;
```

In addition to the response methods listed above, the following methods may be used to determine if the response has a given status code:

```
$response->ok() : bool;                  // 200 OK
$response->created() : bool;             // 201 Created
$response->accepted() : bool;            // 202 Accepted
$response->noContent() : bool;           // 204 No Content
$response->movedPermanently() : bool;    // 301 Moved Permanently
$response->found() : bool;               // 302 Found
$response->badRequest() : bool;          // 400 Bad Request
$response->unauthorized() : bool;        // 401 Unauthorized
$response->paymentRequired() : bool;     // 402 Payment Required
$response->forbidden() : bool;           // 403 Forbidden
$response->notFound() : bool;            // 404 Not Found
$response->requestTimeout() : bool;      // 408 Request Timeout
$response->conflict() : bool;            // 409 Conflict
$response->unprocessableEntity() : bool; // 422 Unprocessable Entity
$response->tooManyRequests() : bool;     // 429 Too Many Requests
$response->serverError() : bool;         // 500 Internal Server Error
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Halil Cosdu](https://github.com/halilcosdu)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

52

—

FairBetter than 96% of packages

Maintenance81

Actively maintained with recent releases

Popularity38

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~146 days

Total

5

Last Release

166d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/eb33d4d47ce7f6f885331f34e8ed984e57866237d54526a2e3c97bdcbb11ecbb?d=identicon)[halilcosdu](/maintainers/halilcosdu)

---

Top Contributors

[![halilcosdu](https://avatars.githubusercontent.com/u/6373017?v=4)](https://github.com/halilcosdu "halilcosdu (16 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (7 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (5 commits)")[![micos7](https://avatars.githubusercontent.com/u/4460809?v=4)](https://github.com/micos7 "micos7 (4 commits)")[![dimzeta](https://avatars.githubusercontent.com/u/3192298?v=4)](https://github.com/dimzeta "dimzeta (1 commits)")

---

Tags

laravellaravel-replicateHalilCosdu

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/halilcosdu-laravel-replicate/health.svg)

```
[![Health](https://phpackages.com/badges/halilcosdu-laravel-replicate/health.svg)](https://phpackages.com/packages/halilcosdu-laravel-replicate)
```

###  Alternatives

[spatie/laravel-data

Create unified resources and data transfer objects

1.8k28.9M627](/packages/spatie-laravel-data)[spatie/laravel-livewire-wizard

Build wizards using Livewire

4061.0M4](/packages/spatie-laravel-livewire-wizard)[hirethunk/verbs

An event sourcing package that feels nice.

513162.9k6](/packages/hirethunk-verbs)[worksome/exchange

Check Exchange Rates for any currency in Laravel.

123544.7k](/packages/worksome-exchange)[ralphjsmit/livewire-urls

Get the previous and current url in Livewire.

82270.3k4](/packages/ralphjsmit-livewire-urls)[hydrat/filament-table-layout-toggle

Filament plugin adding a toggle button to tables, allowing user to switch between Grid and Table layouts.

6292.3k1](/packages/hydrat-filament-table-layout-toggle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
