Download the PHP package zeevx/laravel-bachs without Composer

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

Bachs for Laravel

Laravel integration for zeevx/php-bachs. It provides automatic package discovery, container bindings, a facade, publishable configuration, signature verification, a webhook route, and a framework event while leaving billing tables and business rules in your application.

Requirements

Installation

Laravel discovers Zeevx\LaravelBachs\BachsServiceProvider automatically.

Environment

Use https://api.bachs.io for production. Keep the API key and webhook secret server-side and never expose them to browser JavaScript.

Configuration

The published config/bachs.php contains:

Disable the included webhook route when your application needs to register a custom controller or route group.

Resolving the client

Use dependency injection:

Or use the facade:

All SDK resources are available:

See the PHP SDK documentation for response objects, exceptions, and complete examples.

Webhooks

By default, the package registers:

The VerifyWebhookSignature middleware:

  1. Reads the exact raw request body.
  2. Requires X-Bachs-Timestamp and X-Bachs-Signature.
  3. Rejects requests outside the configured tolerance.
  4. Verifies the HMAC SHA-256 signature with BACHS_WEBHOOK_SECRET.
  5. Parses the verified payload into a typed WebhookEvent.

Invalid requests receive a generic HTTP 400 response. Valid requests dispatch Zeevx\LaravelBachs\Events\WebhookReceived and receive HTTP 204.

If the route uses Laravel's web middleware, exempt the configured path from CSRF protection in your application bootstrap:

Handling events

Register a listener in your application:

A queued listener keeps webhook responses fast:

Bachs delivers webhooks at least once. Store the event ID under a unique constraint and make handlers idempotent before granting credits, activating subscriptions, or changing entitlements.

Application responsibilities

This package intentionally does not provide models, migrations, plan configuration, or a Cashier-style billing schema. Your application should own:

Keeping those rules outside the integration package makes the package reusable and prevents provider details from becoming your application domain model.

Testing

The package's Testbench suite verifies container registration, webhook signatures, event dispatch, and invalid-request handling.

In an application test, fake the framework event:

For API client tests, inject or replace the Zeevx\Bachs\Bachs binding with a client configured with Guzzle's MockHandler.

Development

The package uses Pest, Orchestra Testbench, PHPStan level 8, Laravel Pint, strict types, and GitHub Actions across supported PHP and Laravel versions.

License

The MIT License. See LICENSE.


All versions of laravel-bachs with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/contracts Version ^11.0 || ^12.0 || ^13.0
illuminate/http Version ^11.0 || ^12.0 || ^13.0
illuminate/routing Version ^11.0 || ^12.0 || ^13.0
illuminate/support Version ^11.0 || ^12.0 || ^13.0
zeevx/php-bachs Version ^0.1
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 zeevx/laravel-bachs contains the following files

Loading the files please wait ...