Download the PHP package danielgnh/polymarket-laravel without Composer

On this page you can find all versions of the php package danielgnh/polymarket-laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package polymarket-laravel

Polymarket Laravel

Latest Version on Packagist GitHub Tests Action Status Total Downloads

This is a Laravel adapter for the Polymarket PHP SDK, providing easy ways to integrate polymarket in your Laravel application.

Requirements

Installation

You can install the package via Composer:

Quick Setup

Run the install command for guided setup:

This will:

Manual Setup

Alternatively, you can publish the configuration file manually:

Configuration

Add your Polymarket credentials to your .env file:

Configuration Options

All configuration options can be customized in config/polymarket.php:

Option Environment Variable Default Description
api_key POLYMARKET_API_KEY null API key for authenticated requests (optional for read-only)
private_key POLYMARKET_PRIVATE_KEY null Private key for trading operations
chain_id POLYMARKET_CHAIN_ID 137 Blockchain network (137 = Polygon mainnet)
gamma_base_url POLYMARKET_GAMMA_BASE_URL https://gamma-api.polymarket.com Gamma API base URL
clob_base_url POLYMARKET_CLOB_BASE_URL https://clob.polymarket.com CLOB API base URL
bridge_base_url POLYMARKET_BRIDGE_BASE_URL https://bridge-api.polymarket.com Bridge API base URL
timeout POLYMARKET_TIMEOUT 30 Request timeout in seconds
retries POLYMARKET_RETRIES 3 Number of retry attempts
verify_ssl POLYMARKET_VERIFY_SSL true Enable SSL certificate verification

Usage

Using the Facade

The facade provides convenient static access to the Polymarket client:

Dependency Injection

Inject the client directly into your classes:

Trading Operations (CLOB API)

For trading operations, you need to configure both an API key and private key:

Bridge API (Cross-Chain Deposits)

The Bridge API enables deposits from multiple chains, automatically converting to USDC.e on Polygon:

Market Data Examples

Fetching All Markets

Searching Markets

Getting Market Details

Error Handling

The SDK throws specific exceptions for different error scenarios:

Testing

The package includes comprehensive tests:

Mocking in Your Tests

You can easily mock the Polymarket client in your tests:

Advanced Configuration

Custom Timeouts

For long-running operations, adjust the timeout:

Retry Configuration

Configure automatic retry behavior:

Local Development

Disable SSL verification for local testing (not recommended for production):

Custom API URLs

Use custom API endpoints (useful for testing):

Changelog

Please see CHANGELOG for more information on recent changes.

Contributing

Contributions are welcome! In case if you found any bug or have an idea just open an issue and create a Pull Request.

Security

If you discover any security-related issues, please email [email protected] instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of polymarket-laravel with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
polymarket-php/polymarket Version ^1.2
illuminate/contracts Version ^10.0|^11.0|^12.0
spatie/laravel-package-tools Version ^1.16
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package danielgnh/polymarket-laravel contains the following files

Loading the files please wait ...