Download the PHP package martinbean/mux-php-laravel without Composer
On this page you can find all versions of the php package martinbean/mux-php-laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download martinbean/mux-php-laravel
More information about martinbean/mux-php-laravel
Files in martinbean/mux-php-laravel
Package mux-php-laravel
Short Description Laravel wrapper for the official Mux PHP SDK.
License MIT
Informations about the package mux-php-laravel
Mux PHP SDK for Laravel
Installation
Configuration
By default, the package expects two environment variables to be defined:
MUX_CLIENT_ID
MUX_CLIENT_SECRET
This should be a Mux access token ID and secret.
You can generate a Mux access token by:
- Logging into your Mux dashboard
- Going to “Settings”
- Then going to “Access Tokens”
Verifying webhook signatures
To verify webhook signatures from Mux, specify the signing secret for your webhook endpoint as the value of your MUX_WEBHOOK_SECRET
environment variable. This means you will need to register your webhook endpoint in the Mux dashboard first.
Usage
API clients
The package will register default configuration based on the configured Mux access token. This means you can then type-hint a Mux client in your Laravel application, and it and its dependencies will be automatically resolved:
Webhook handling
The package will also automatically register a route to listen for webhooks sent by Mux. The URI of this handler is /mux/webhook
The webhook handler is heavily based on Cashier’s webhook handler. When a webhook from Mux is received, an instance of the MartinBean\Laravel\Mux\Events\WebhookReceived
event is dispatched containing the webhook’s payload.
You can define a listener that listens for this event:
This is where you would update models, etc in your application based on events from Mux:
Contribution
Contributions are always welcome. Please open a pull request with your proposed changes, with accompanying tests.
License
Licensed under the MIT License
All versions of mux-php-laravel with dependencies
illuminate/routing Version ^11.0
illuminate/support Version ^11.0
muxinc/mux-php Version ^3.0