Skip to content

Commit 4b1180e

Browse files
authored
Merge pull request #142 from hotwired-laravel/tm/l11
Laravel 11 Support
2 parents 348ffa7 + 3802ec1 commit 4b1180e

16 files changed

+92
-297
lines changed

.github/workflows/run-tests.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,15 @@ jobs:
1010
matrix:
1111
os: [ubuntu-latest, macos-latest]
1212
php: [8.2]
13-
laravel: [10.*]
13+
laravel: [10.*, 11.*]
1414
stability: [prefer-lowest, prefer-stable]
1515
include:
1616
- laravel: 10.*
1717
testbench: 8.*
18+
workbench: 8.*
19+
- laravel: 11.*
20+
testbench: 9.*
21+
workbench: 9.*
1822

1923
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}
2024

@@ -36,7 +40,7 @@ jobs:
3640
3741
- name: Install dependencies
3842
run: |
39-
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" "nesbot/carbon:^2.64.1" --no-interaction --no-update
43+
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" "orchestra/workbench:${{ matrix.workbench }}" "nesbot/carbon:^2.64.1" --no-interaction --no-update
4044
composer update --${{ matrix.stability }} --prefer-dist --no-interaction
4145
4246
- name: Execute tests

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
.php_cs.cache
44
.php-cs-fixer.cache
55
.phpunit.result.cache
6+
.phpunit.cache
67
build
78
composer.lock
89
coverage

composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@
1919
],
2020
"require": {
2121
"php": "^8.2",
22-
"illuminate/support": "^10.0"
22+
"illuminate/support": "^10.0|^11.0"
2323
},
2424
"require-dev": {
2525
"laravel/pint": "^1.10",
26-
"orchestra/testbench": "^8.14",
27-
"orchestra/workbench": "^1.0",
28-
"phpunit/phpunit": "^9.6"
26+
"orchestra/testbench": "^8.14|^9.0",
27+
"orchestra/workbench": "^8.0|^9.0",
28+
"phpunit/phpunit": "^10.5"
2929
},
3030
"autoload": {
3131
"psr-4": {

docs/installation.md

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Turbo Laravel can be installed via [Composer](https://getcomposer.org/):
44

55
```bash
6-
composer require hotwired-laravel/turbo-laravel:^2.0.0-beta1
6+
composer require hotwired-laravel/turbo-laravel:^2.0.0
77
```
88

99
After installing the package, you may run the `turbo:install` Artisan command. This command will add the Turbo.js dependency to your `package.json` file (when you're using Vite and NPM) or to your `routes/importmap.php` file (when it detects that you're using [Importmap Laravel](https://github.com/tonysm/importmap-laravel)). It also publishes some files to your `resources/js` folder, which imports Turbo for you:
@@ -12,16 +12,6 @@ After installing the package, you may run the `turbo:install` Artisan command. T
1212
php artisan turbo:install
1313
```
1414

15-
If you're using [Laravel Jetstream](https://jetstream.laravel.com/introduction.html) with [Livewire](https://livewire.laravel.com/), you may add the `--jet` flag to the `turbo:install` Artisan command. This flag will add some required JS dependencies to make sure [Alpine.js](https://alpinejs.dev/) works well with Turbo. It also changes the layout files that ships with Jetstream adding the [Livewire Turbo Plugin](https://github.com/livewire/turbolinks) to make sure Livewire works well with Turbo, too:
16-
17-
```bash
18-
php artisan turbo:install --jet
19-
```
20-
21-
If you're using [Alpine.js](https://alpinejs.dev/) in a non-Jetstream context (maybe you're more into [Breeze](https://laravel.com/docs/starter-kits#laravel-breeze)), you may use the `--alpine` flag in the `turbo:install` Artisan command:
22-
23-
```bash
24-
php artisan turbo:install --alpine
25-
```
15+
Note: Turbo used to work with Livewire, but somewhere around Livewire V3 the bridges stopped working. There's an open issue to investigate Livewire V3 compatibility. If you're into Livewire and would love to use Turbo in a Livewire app (maybe you want to augment your Livewire&Turbo app with Turbo Native or something like that), you're welcome to check out the issue and try to bring the compatibility back. If you wanted an application scaffolding like Laravel Breeze or Laravel Jetstream, checkout Turbo Breeze, our fork of Breeze that sets up a fresh Laravel app using Stimulus, Importmaps, TailwindCSS (via the CLI), and Turbo.
2616

2717
[Continue to Overview...](/docs/{{version}}/overview)

phpunit.xml.dist

Lines changed: 17 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,29 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit backupGlobals="false"
3-
backupStaticAttributes="false"
4-
bootstrap="vendor/autoload.php"
5-
colors="true"
6-
convertErrorsToExceptions="true"
7-
convertNoticesToExceptions="true"
8-
convertWarningsToExceptions="true"
9-
processIsolation="false"
10-
stopOnFailure="false"
11-
verbose="true"
2+
<phpunit
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
backupGlobals="false"
5+
bootstrap="vendor/autoload.php"
6+
colors="true"
7+
processIsolation="false"
8+
stopOnFailure="false"
9+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
10+
cacheDirectory=".phpunit.cache"
11+
backupStaticProperties="false"
1212
>
1313
<testsuites>
1414
<testsuite name="Turbo Laravel Test Suite">
1515
<directory>tests</directory>
1616
</testsuite>
1717
</testsuites>
18-
<coverage>
19-
<include>
20-
<directory suffix=".php">./src</directory>
21-
</include>
22-
<report>
23-
<html outputDirectory="build/coverage"/>
24-
<text outputFile="build/coverage.txt"/>
25-
<clover outputFile="build/logs/clover.xml"/>
26-
</report>
27-
</coverage>
2818
<logging>
29-
<junit outputFile="build/report.junit.xml"/>
19+
<junit outputFile="build/report.junit.xml" />
3020
</logging>
3121
<php>
32-
<env name="APP_KEY" value="a2ps3dFoNmyehsm7r0VFZ0Iq64hwBpqI"/>
22+
<env name="APP_KEY" value="a2ps3dFoNmyehsm7r0VFZ0Iq64hwBpqI" />
3323
</php>
24+
<source>
25+
<include>
26+
<directory suffix=".php">./src</directory>
27+
</include>
28+
</source>
3429
</phpunit>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<meta name="view-transition" content="same-origin" />

src/Broadcasters/Broadcaster.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ interface Broadcaster
88
{
99
/**
1010
* @param Channel[] $channels
11-
* @param ?string $target = null
12-
* @param ?string $targets = null
13-
* @param ?string $partial = null
14-
* @param ?array $partialData = []
15-
* @param ?string $inlineContent = null
16-
* @param bool $escapeInlineContent = true
17-
* @param ?string $exceptSocket = null
11+
* @param ?string $target = null
12+
* @param ?string $targets = null
13+
* @param ?string $partial = null
14+
* @param ?array $partialData = []
15+
* @param ?string $inlineContent = null
16+
* @param bool $escapeInlineContent = true
17+
* @param ?string $exceptSocket = null
1818
*/
1919
public function broadcast(
2020
array $channels,

src/Broadcasters/LaravelBroadcaster.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ class LaravelBroadcaster implements Broadcaster
88
{
99
/**
1010
* @param \Illuminate\Broadcasting\Channel[] $channels
11-
* @param ?string $target = null
12-
* @param ?string $targets = null
13-
* @param ?string $partial = null
14-
* @param ?array $partialData = []
15-
* @param ?string $inlineContent = null
16-
* @param bool $escapeInlineContent = true
17-
* @param array $attributes = []
18-
* @param ?string $exceptSocket = null
11+
* @param ?string $target = null
12+
* @param ?string $targets = null
13+
* @param ?string $partial = null
14+
* @param ?array $partialData = []
15+
* @param ?string $inlineContent = null
16+
* @param bool $escapeInlineContent = true
17+
* @param array $attributes = []
18+
* @param ?string $exceptSocket = null
1919
*/
2020
public function broadcast(
2121
array $channels,

src/Commands/Tasks/EnsureLivewireTurboBridgeExists.php

Lines changed: 0 additions & 46 deletions
This file was deleted.

0 commit comments

Comments
 (0)