Download the PHP package bestcompany/bestcompany-api without Composer

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

Bestcompany & Snoball API Wrapper

Latest Version on Packagist Total Downloads GitHub Actions

This package provides Laravel-compatible API wrappers for both Bestcompany and Snoball services, with automatic resource separation and type-safe dependency injection.

Installation

You can install the package via composer:

Then if using laravel publish your config file by running the command.

php artisan vendor:publish --provider="Bestcompany\BestcompanyApi\BestcompanyApiServiceProvider" --tag="config"

Add your api key to the .env using the key from the config file.

Usage

Separate API Clients

This package provides separate API clients for different services:

Using BestcompanyApi

Using SnoballApi

Laravel Usage with Dependency Injection

Available Resources

BestcompanyApi Resources

SnoballApi Resources

Configuration

Configuration

The package requires explicit configuration to be passed to each API client. The Laravel service provider handles this automatically using environment variables and config files.

Environment Variables:

Laravel Configuration: After publishing the config files, you can configure these in config/bestcompany-api.php and config/snoball.php:

Manual Configuration: When creating API instances manually (outside of Laravel), you must provide the configuration explicitly:

Note: The API clients no longer fall back to environment variables automatically. Configuration must be explicitly provided either through the Laravel service provider or when creating instances manually.

Laravel Facades (Optional)

You can also use Laravel facades for easier access:

Error Handling

The package automatically prevents cross-API resource access:

The error messages will show you which resources are available for each API client.

Structured request errors (SnoballApi referral requests)

When a Snoball API request fails, the resource throws a typed Bestcompany\BestcompanyApi\Exceptions\SnoballApiException instead of a raw Guzzle exception. It carries a stable, machine-readable Bestcompany\BestcompanyApi\Enums\SnoballApiErrorCode and — importantly — the server's own judgment of whether the error is safe to show an end user, so you never have to string-match a message to decide what to surface:

Switch on $e->errorCode() when you need to react to a specific condition (e.g. SnoballApiErrorCode::ReferralLimitReached). Any code the server introduces before this SDK is upgraded resolves to null; treat unknown codes as not user-safe. Responses that predate the structured envelope degrade gracefully — errorCode() is null, isUserSafe() is false, and getMessage() returns the raw body message.

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

Credits

License

The Apache License 2. Please see License File for more information.

Laravel Package Boilerplate

This package was generated using the Laravel Package Boilerplate.


All versions of bestcompany-api with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
guzzlehttp/guzzle Version ^7.7
illuminate/support Version ^11.0|^12.0|^13.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 bestcompany/bestcompany-api contains the following files

Loading the files please wait ...