Skip to content

Commit 95a75e9

Browse files
authored
Merge pull request #61 from daun/develop
Prepare release
2 parents a1e9ce8 + 24cd3b1 commit 95a75e9

51 files changed

Lines changed: 2164 additions & 221 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
fail-fast: true
1414
matrix:
1515
php: [8.4, 8.3, 8.2]
16-
laravel: [12.*, 11.*, 10.*, 9.*]
16+
laravel: [12.*, 11.*, 10.*]
1717
statamic: [5.*, 4.*]
1818
include:
1919
- laravel: 12.*
@@ -28,13 +28,7 @@ jobs:
2828
testbench: 8.*
2929
pest: 2.*
3030
snapshots: 2.*
31-
- laravel: 9.*
32-
testbench: 7.*
33-
pest: 1.*
34-
snapshots: 1.*
3531
exclude:
36-
- statamic: 5.*
37-
laravel: 9.*
3832
- statamic: 4.*
3933
laravel: 12.*
4034
- statamic: 4.*
@@ -71,7 +65,7 @@ jobs:
7165

7266
- name: Check code coverage
7367
uses: codecov/codecov-action@v4
74-
if: ${{ matrix.php == '8.3' && matrix.laravel == '12.*' }}
68+
if: ${{ matrix.php == '8.4' && matrix.laravel == '12.*' }}
7569
with:
7670
file: ./coverage.xml
7771
token: ${{ secrets.CODECOV_TOKEN }}

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Changelog
22

3+
## [2.0.0] - 2025-11-22
4+
5+
- Add configurable logger for simpler troubleshooting
6+
- Add `mux:debug` command for ensuring correct configuration
7+
- Make Guzzle requests hookable for advanced use cases
8+
- Remove support for Laravel 9 and PHP 8.1 (breaking change)
9+
310
## [1.8.0] - 2025-11-15
411

512
- Add option to lazyload web component scripts
@@ -112,9 +119,11 @@
112119

113120
- Beta release
114121

122+
[2.0.0]: https://github.com/daun/statamic-mux/releases/tag/2.0.0
115123
[1.8.0]: https://github.com/daun/statamic-mux/releases/tag/1.8.0
116124
[1.7.0]: https://github.com/daun/statamic-mux/releases/tag/1.7.0
117125
[1.6.0]: https://github.com/daun/statamic-mux/releases/tag/1.6.0
126+
[1.5.4]: https://github.com/daun/statamic-mux/releases/tag/1.5.4
118127
[1.5.3]: https://github.com/daun/statamic-mux/releases/tag/1.5.3
119128
[1.5.2]: https://github.com/daun/statamic-mux/releases/tag/1.5.2
120129
[1.5.1]: https://github.com/daun/statamic-mux/releases/tag/1.5.1

CLAUDE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ Mock fixtures are stored in `tests/__fixtures__/` for consistent testing.
9898

9999
### Dependencies and Libraries
100100

101-
- **PHP 8.1+**: Base language requirement
102-
- **Laravel 9+**: Framework foundation
101+
- **PHP 8.2+**: Base language requirement
102+
- **Laravel 10+**: Framework foundation
103103
- **Statamic 4+**: CMS platform
104104
- **Mux PHP SDK**: Official API client for Mux services
105105
- **Vue 2**: Frontend components

composer.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626
"php": "^8.2",
2727
"firebase/php-jwt": "^6.10",
2828
"guzzlehttp/guzzle": "^7.8",
29-
"laravel/framework": "^9.21 || ^10.0 || ^11.0 || ^12.0",
29+
"laravel/framework": "^10.0 || ^11.0 || ^12.0",
30+
"leocavalcante/redact-sensitive": "^0.4.1",
3031
"muxinc/mux-php": "^5.0",
3132
"srwiez/thumbhash": "^1.2",
3233
"statamic/cms": "^4.0 || ^5.0"
@@ -84,7 +85,7 @@
8485
},
8586
"scripts": {
8687
"analyse": "./vendor/bin/phpstan analyse --memory-limit=2G",
87-
"facade": "php -f vendor/bin/facade.php -- \\\\Daun\\\\StatamicMux\\\\Facades\\\\Mux",
88+
"facade": "php -f vendor/bin/facade.php -- \\\\Daun\\\\StatamicMux\\\\Facades\\\\Mux \\\\Daun\\\\StatamicMux\\\\Facades\\\\Log",
8889
"format": "./vendor/bin/pint",
8990
"lint": "./vendor/bin/pint --test",
9091
"test": "./vendor/bin/pest",

config/mux.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,4 +171,27 @@
171171
'queue' => env('MUX_QUEUE', 'default'),
172172

173173
],
174+
175+
/*
176+
|--------------------------------------------------------------------------
177+
| Logging
178+
|--------------------------------------------------------------------------
179+
|
180+
| Configure logging for the addon by writing to a custom channel defined in
181+
| your app's `logging` config, or use the default 'mux' channel.
182+
|
183+
| For debugging uploads and video processing, set the log level to `debug`.
184+
|
185+
*/
186+
187+
'logging' => [
188+
189+
'enabled' => env('MUX_LOG_ENABLED', true),
190+
191+
'channel' => env('MUX_LOG_CHANNEL', 'mux'),
192+
193+
'level' => env('MUX_LOG_LEVEL', env('LOG_LEVEL', 'debug')),
194+
195+
],
196+
174197
];

docs/commands.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@ The following commands are available for uploading videos manually or in regular
55
| Command | Description |
66
|-------|-----------|
77
| [**`mux:upload`**](/commands/mux-upload) | Upload local video assets to Mux |
8-
| [**`mux:prune`**](/commands/mux-upload) | Remove orphaned videos from Mux |
9-
| [**`mux:mirror`**](/tags/mux-video) | Upload local videos to Mux & remove orphaned Mux videos |
8+
| [**`mux:prune`**](/commands/mux-prune) | Remove orphaned videos from Mux |
9+
| [**`mux:mirror`**](/commands/mux-mirror) | Upload local videos to Mux & remove orphaned Mux videos |
10+
| [**`mux:debug`**](/commands/mux-debug) | Debug Mux configuration and setup |

docs/commands/mux-debug.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# `mux:debug` <Badge type="info">Artisan Command</Badge>
2+
3+
**Debug Mux configuration and setup.**
4+
5+
Warn about missing credentials, misconfigured queue, disabled mirror feature,
6+
and missing asset containers with Mux Mirror fields.
7+
8+
```sh
9+
# Check for Mux configuration issues
10+
php please mux:debug
11+
```
12+
13+
Example output:
14+
15+
```sh
16+
✓ Mux is configured with credentials.
17+
✓ The queue is configured to use a background worker.
18+
✓ The mirror feature is globally enabled.
19+
✗ No asset containers found with Mux Mirror fields.
20+
```
21+
22+
<!--@include: ../partials/command-names.md-->

docs/configuration.md

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ return [
8282
## Test Mode
8383

8484
Mux offers a test mode for evaluating their service without incurring charges for storage or streaming.
85-
All videos uploaded in test mode are watermarked and deleted after 24 hours.
85+
All videos uploaded in test mode are watermarked and deleted after 24 hours. This is recommended during
86+
initial setup and on development machines.
8687

8788
```php
8889
return [
@@ -179,7 +180,7 @@ streaming and downloading the full video.
179180

180181
Any videos shorter than the defined placeholder length will keep the original.
181182

182-
Note that this feature requires a [queue worker](https://laravel.com/docs/12.x/queues#running-the-queue-worker)
183+
Note that this feature requires a [queue worker](https://laravel.com/docs/queues#running-the-queue-worker)
183184
to be running, as the video processing can take some time depending on the file size.
184185

185186
```php
@@ -220,3 +221,36 @@ return [
220221
],
221222
];
222223
```
224+
225+
## Logging
226+
227+
Configure the output and verbosity of the addon's logs.
228+
229+
For troubleshooting uploads and getting insight into the processing of video files,
230+
you can increase the log level to `debug` temporarily. Make sure to set it back to
231+
`notice` or `warning` in production to avoid excessive log output.
232+
233+
The addon creates its own log channel, writing to `storage/logs/mux.log` and
234+
rotating biweekly. You can customize the log channel by either defining a `mux`
235+
channel of your own in `config/logging.php` or telling the addon to use a
236+
different channel entirely.
237+
238+
```php
239+
return [
240+
/*
241+
|--------------------------------------------------------------------------
242+
| Logging
243+
|--------------------------------------------------------------------------
244+
*/
245+
246+
'logging' => [
247+
248+
'enabled' => env('MUX_LOG_ENABLED', true),
249+
250+
'channel' => env('MUX_LOG_CHANNEL', 'mux'), // [!code focus]
251+
252+
'level' => env('MUX_LOG_LEVEL', env('LOG_LEVEL', 'debug')), // [!code focus]
253+
254+
],
255+
];
256+
```

docs/connecting-mux.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ MUX_TOKEN_SECRET=YjNiN2ZhOWItZWZkNi00NzIzLWJlZDItMDMyYjA0ZTYxNDg4/l0eZQPmr1S+z+b
2222
## Test Mode
2323

2424
Mux offers a test mode for evaluating their service without incurring charges for storage or streaming.
25-
All videos uploaded in test mode are watermarked and deleted after 24 hours. You can enable test mode
26-
from an environment variable.
25+
All videos uploaded in test mode are watermarked and deleted after 24 hours. This is recommended during
26+
initial setup and on development machines. You can enable test mode from an environment variable.
2727

2828
```env
2929
MUX_TEST_MODE=true

docs/hooks.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,16 @@ Mux::hook('asset-meta', function ($payload, $next) {
5656
return $next($payload);
5757
});
5858
```
59+
60+
### API Request
61+
62+
Inspect or modify the Guzzle request before it is sent to Mux's API.
63+
64+
```php
65+
// Change user agent header
66+
Mux::hook('api-request', function ($payload, $next) {
67+
$payload->request = $payload->request->withHeader('User-Agent', 'MyApp/1.0');
68+
69+
return $next($payload);
70+
});
71+
```

0 commit comments

Comments
 (0)