Download the PHP package andonovn/laravel-bets-api without Composer

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

Laravel Bets Api

Description

A package which helps you use the API of BetsApi. BetsApi is a paid service which provides sports data. You can find more about them at https://betsapi.com.

Laravel Bets Api is an unofficial package and not all of the endpoints are covered. I am just a client of theirs which happens to use their services on few projects and that motivated me to extract the code into an open-source package.

Installation

Add the BETS_API_TOKEN env variable to your .env file. As you may already guessed, that's the BetsApi token that you can obtain by registering in their website, and then subscribing to a plan of your choice.

You can also optionally add the BETS_API_ENDPOINT env variable. By default it is set to https://api.b365api.com/v1/

The package utilize the Laravel's package auto-discovery feature. If you use an old version of Laravel that does not support that, then you can manually add Andonovn\LaravelBetsApi\ServiceProvider to the list of your service providers which are located in the /config/app.php's providers array

Usage

Resolve the Andonovn\LaravelBetsApi\BetsApi class from the container and use one of the public methods. Here is an example:

Error handling

An Andonovn\LaravelBetsApi\Exceptions\CallFailedException will be raised when an API call fails. Also, there are few more exceptions which are less likely to occur but you can be safe by handling all of them by just catching the abstract Andonovn\LaravelBetsApi\Exceptions\BetsApiException. In case you want to learn more about the exceptions, they are all located in the Andonovn\LaravelBetsApi\Exceptions namespace.

Events

An Andonovn\LaravelBetsApi\Events\RequestFailed will be dispatched when a request fails. The package will try to retry the request until it hits the max allowed retries specified in the config. Note that the event will be raised for every retry that was made. When it hits the attempts limit, it will throw the Andonovn\LaravelBetsApi\Exceptions\CallFailedException exception as described above.

There is one more event that the package raise and that's the Andonovn\LaravelBetsApi\Events\ResponseReceived which you may use to track how many requests you have left, and other similar info that's available in each response.


All versions of laravel-bets-api with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1.3
illuminate/support Version >=9.0
illuminate/events Version >=9.0
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 andonovn/laravel-bets-api contains the following files

Loading the files please wait ....