PHPackages                             joggapp/laravel-mux - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Image &amp; Media](/categories/media)
4. /
5. joggapp/laravel-mux

ActiveLibrary[Image &amp; Media](/categories/media)

joggapp/laravel-mux
===================

Laravel package for Mux API

v5.10(1y ago)16MITPHPPHP ^8.1CI passing

Since May 23Pushed 3w ago3 watchersCompare

[ Source](https://github.com/JoggApp/laravel-mux)[ Packagist](https://packagist.org/packages/joggapp/laravel-mux)[ RSS](/packages/joggapp-laravel-mux/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (10)Dependencies (6)Versions (22)Used By (0)

Laravel package for Mux' API
============================

[](#laravel-package-for-mux-api)

[![Latest Version](https://camo.githubusercontent.com/013c3910fbc01257d224730ce743590e06dc7109141677d1dc7c84e327034f46/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f4a6f67674170702f6c61726176656c2d6e61747572616c2d6c616e67756167652e7376673f7374796c653d666c61742d726f756e646564)](https://github.com/JoggApp/laravel-mux/releases)[![](https://github.com/JoggApp/laravel-mux/workflows/Run%20Tests/badge.svg?branch=master)](https://github.com/JoggApp/laravel-mux/workflows/Run%20Tests/badge.svg?branch=master)[![Total Downloads](https://camo.githubusercontent.com/d670e068ae5ad5793daccb2206163047ecf94d90d8c77933e462980be7a28baf/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f4a6f67674170702f6c61726176656c2d6e61747572616c2d6c616e67756167652e7376673f7374796c653d666c61742d726f756e64656426636f6c6f72423d627269676874677265656e)](https://packagist.org/packages/JoggApp/laravel-mux)

This package makes using Mux' API with a laravel app easy and simple.

---

Installation
------------

[](#installation)

- You can install this package via composer using this command:

```
composer require joggapp/laravel-mux
```

- The package will automatically register itself.
- You can publish the config file, database tables, webhook route using the following command:

```
php artisan vendor:publish --provider="JoggApp\Mux\MuxServiceProvider"
```

This will create the package's config file called `laravel-mux.php` in the `config` directory. These are the contents of the published config file:

```
return [
    'access_token' => env('MUX_ACCESS_TOKEN'),

    'secret_key' => env('MUX_SECRET_KEY'),

    'api_url' => env('MUX_API_URL', 'https://api.mux.com/video/v1'),

    'webhook_processing_queue' => env('MUX_WEBHOOK_PROCESSING_QUEUE', 'encoding'),

    'webhook_secret' => env('MUX_WEBHOOK_SECRET')
];
```

How to use
----------

[](#how-to-use)

- Setup config

    - `webhook_secret` can be found in Mux dashboard under Settings &gt; Webhooks:

     [![205170051-1fa985bb-5c02-4b05-9a09-0a55755a0048](https://user-images.githubusercontent.com/15527144/205171246-518bd524-2a01-4c56-b0ac-ecc164e03e57.png)](https://user-images.githubusercontent.com/15527144/205171246-518bd524-2a01-4c56-b0ac-ecc164e03e57.png)
- Run migrations
- You then need to pass the route to `muxWebhook` in your routes file:

```
Route::muxWebhook('route-you-prefer')->middleware('validate.mux.signature');
```

- You need to implement the `JoggApp\Mux\Contracts\Media` interface on the model you want to use as the one to be operated on. Eg: App\\Models\\Video. You will also need to implement the methods that interface asks for in your model.
- The command `JoggApp\Mux\Commands\KeepCheckingForLaravelMuxErrors` is scheduled to run every minute via this packages service-provider. Make sure you have run the migrations. You can set the threshold count in the config file, if which is crossed in the last hour the pkg will emit an event `MuxErrorsThresholdCrossed` that you can hook into and do anything you like, for eg notify on slack, swap services etc. The count has been set to a sensible default of 3 per hour.
- The available methods are:

```
Mux::encode(Media $media, array $options = []): Response
```

```
Mux::addCaptionsToVideo(Media $media, array $options = []): Response
```

```
Mux::getAssetDetails(string $assetId): Response
```

- There is a `ValidateMuxSignature` middleware available which when applied to the mux webhook route, will take care of the webhook secret verification.
- This package emits the following events:

1. `MuxAddingCaptionsToVideoFailed`
2. `MuxAddingCaptionsToVideoSuccessful`
3. `MuxMediaEncodingFailed`
4. `MuxMediaEncodingSuccessful`
5. `MuxVideoAssetFailedWebhookReceived`
6. `MuxVideoAssetReadyWebhookReceived`
7. `MuxVideoAssetStaticRenditionsReadyWebhookReceived`
8. `MuxErrorsThresholdCrossed`

Testing
-------

[](#testing)

You can run the tests with:

```
vendor/bin/phpunit
```

Changelog
---------

[](#changelog)

Please see the [CHANGELOG](CHANGELOG.md) for more information about what has changed recently.

Security
--------

[](#security)

If you discover any security related issues, please email them to  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Harish Toshniwal](https://github.com/introwit)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see the [License File](LICENSE.txt) for more information.

###  Health Score

42

—

FairBetter than 88% of packages

Maintenance72

Regular maintenance activity

Popularity8

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 68.2% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~51 days

Recently: every ~0 days

Total

21

Last Release

447d ago

Major Versions

v0.3 → v1.02022-07-19

v1.0 → v2.02022-08-01

v2.0 → v3.02022-08-23

v3.2 → v4.02023-03-02

v4.1 → v5.02024-03-13

PHP version history (2 changes)v0.1PHP ^8.1

v5.0PHP ^8.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/11228182?v=4)[Harish Toshniwal](/maintainers/introwit)[@introwit](https://github.com/introwit)

---

Top Contributors

[![introwit](https://avatars.githubusercontent.com/u/11228182?v=4)](https://github.com/introwit "introwit (30 commits)")[![karenirenecano](https://avatars.githubusercontent.com/u/15527144?v=4)](https://github.com/karenirenecano "karenirenecano (10 commits)")[![danielluong](https://avatars.githubusercontent.com/u/6686376?v=4)](https://github.com/danielluong "danielluong (4 commits)")

---

Tags

laravelpackagevideomuxvideo-encoding

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/joggapp-laravel-mux/health.svg)

```
[![Health](https://phpackages.com/badges/joggapp-laravel-mux/health.svg)](https://phpackages.com/packages/joggapp-laravel-mux)
```

###  Alternatives

[larastan/larastan

Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel

6.4k51.0M7.4k](/packages/larastan-larastan)[psalm/plugin-laravel

Psalm plugin for Laravel

3325.1M337](/packages/psalm-plugin-laravel)[spatie/laravel-responsecache

Speed up a Laravel application by caching the entire response

2.8k8.7M64](/packages/spatie-laravel-responsecache)[laravel/mcp

Rapidly build MCP servers for your Laravel applications.

76318.2M110](/packages/laravel-mcp)[intervention/image-laravel

Laravel Integration of Intervention Image

1558.1M158](/packages/intervention-image-laravel)[ralphjsmit/laravel-glide

Auto-magically generate responsive images from static image files.

4923.6k5](/packages/ralphjsmit-laravel-glide)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
