Download the PHP package kevinrider/laravel-etrade without Composer

On this page you can find all versions of the php package kevinrider/laravel-etrade. 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 laravel-etrade

social-preview
Latest Version Unit tests GitHub issues License

Laravel client for the E*TRADE v1 API. This is a rewrite of phpetrade that uses Laravel conventions, Guzzle, Carbon, and complete data transfer object (DTO) coverage for E*TRADE API request and response objects.

Disclosure

This package is not affiliated with, endorsed by, or supported by E*TRADE or any of its affiliates or owners. Use at your own risk and review the E*TRADE API terms before use.

The developer is not responsible for any losses incurred from the use of this code. Laravel-etrade comes with absolutely no warranty and should not be used in actual trading unless you (the user) can read and understand the source code. Orders placed with this code (in production mode) will submit trades that will be advertised on the open market and will immediately be filled if a counterparty is present, regardless of whether you made a mistake or not. It is your responsibility to understand, test (in the sandbox), and refine your trades and the code where necessary before using in a live market environment.

Use the sandbox environment before moving to production, especially if you are going to place orders! When starting in the production environment you should create and test your trades and code. This can include submitting orders when the regular market session is closed and setting the marketSession to REGULAR. You can also submit trades with a limit price that is far below the market bid if going long or well above the ask if you are going short. Do not use priceType=MARKET trades unless you want an immediate fill on the order. MARKET trades are definitely not recommended for options, especially those on low liquidity symbols or on strike prices that are deep OTM.

Features

Key files

Requirements

Installation

Install via Composer:

Publish the config file:

You should consider locking to a specific laravel-etrade version in composer.json. For example, in the composer.json require section:

will prevent updates and lock to version 1.0.0. If newer versions are released you can test and then release to your Laravel app as needed.

Configuration

The package is configured in config/laravel-etrade.php. Most likely the only variable you will change is setting production to true when you are ready to use your live E*TRADE account.

The default app_key and app_secret config pulls from env. This means you can either set them in your .env file:

OR

Copy the following into your .bashrc (assuming you're using bash), updating as needed for your specific config:

Don't forget to apply the bash profile changes:

When approved by E*TRADE for API access, you will be issued two sets of keys, one for production and one for the sandbox. You must copy your sandbox key and secret into ETRADE_APP_KEY and ETRADE_APP_SECRET when using the sandbox and vice versa when switching to production.

Authorization flow

The flow uses "out of band" (OOB) verification:

  1. Call getAuthorizationUrl() to retrieve the login URL.
  2. Log in to E*TRADE, approve the app, and copy the verifier code.
  3. Paste the verifier code into requestAccessTokenAndStore().
  4. The access token is stored in cache and used automatically.

Usage

EtradeApiClient

Resolve the client through the Laravel container:

EtradeOrderBuilder

Use the builder to generate preview/place order request DTOs:

Exceptions

Examples and demo

LaravelEtradeDemo serves as a demonstration of all E*TRADE API endpoints and as EtradeApiClient and EtradeOrderBuilder example code in a variety of scenarios and trade types.

Run the interactive demo via artisan:

It walks through OAuth, read-only endpoints, and order flows with warnings before any destructive actions or placing any orders.

Be careful! LaravelEtradeDemo will place live orders if production mode is used!

Testing

If you installed with dev dependencies, the following will run all tests:

Further reading


All versions of laravel-etrade with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3|^8.4|^8.5
guzzlehttp/guzzle Version ^7.10
illuminate/contracts Version ^10.0|^11.0|^12.0
guzzlehttp/oauth-subscriber Version ^0.8
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 kevinrider/laravel-etrade contains the following files

Loading the files please wait ...