Skip to content

Commit a3fe302

Browse files
authored
Merge pull request #159 from hotwired-laravel/tm/l13
Laravel 13.x Compatibility
2 parents 0714813 + 4c68478 commit a3fe302

3 files changed

Lines changed: 18 additions & 6 deletions

File tree

.github/workflows/run-tests.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ jobs:
99
fail-fast: true
1010
matrix:
1111
os: [ubuntu-latest]
12-
php: [8.2, 8.3, 8.4]
13-
laravel: [11.*, 12.*]
12+
php: [8.2, 8.3, 8.4, 8.5]
13+
laravel: [11.*, 12.*, 13.*]
1414
stability: [prefer-lowest, prefer-stable]
1515
include:
1616
- laravel: 11.*
@@ -19,6 +19,12 @@ jobs:
1919
- laravel: 12.*
2020
testbench: 10.*
2121
workbench: 10.*
22+
- laravel: 13.*
23+
testbench: 11.*
24+
workbench: 11.*
25+
exclude:
26+
- laravel: 13.*
27+
php: 8.2
2228

2329
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}
2430

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@
1919
],
2020
"require": {
2121
"php": "^8.2",
22-
"illuminate/support": "^11.0|^12.0"
22+
"illuminate/support": "^11.0|^12.0|^13.0"
2323
},
2424
"require-dev": {
2525
"laravel/pint": "^1.10",
26-
"orchestra/testbench": "^9.0|^10.0",
27-
"orchestra/workbench": "^9.0|^10.0",
26+
"orchestra/testbench": "^9.0|^10.0|^11.0",
27+
"orchestra/workbench": "^9.0|^10.0|^11.0",
2828
"phpunit/phpunit": "^10.5|^11.5"
2929
},
3030
"autoload": {

src/Models/Broadcasts.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,13 @@ trait Broadcasts
2121

2222
public static function bootBroadcasts(): void
2323
{
24-
static::observe(new ModelObserver);
24+
if (method_exists(static::class, 'whenBooted')) {
25+
static::whenBooted(function () {
26+
static::observe(new ModelObserver);
27+
});
28+
} else {
29+
static::observe(new ModelObserver);
30+
}
2531
}
2632

2733
public static function withoutTurboStreamBroadcasts(callable $callback)

0 commit comments

Comments
 (0)