Skip to content

Commit 74c3e06

Browse files
committed
Add Laravel 6 support and ignition solution
1 parent 0ffc19a commit 74c3e06

File tree

3 files changed

+25
-11
lines changed

3 files changed

+25
-11
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ build
22
composer.lock
33
docs
44
vendor
5-
coverage
5+
coverage
6+
.phpunit.result.cache

composer.json

+10-9
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,22 @@
2626
"ext-json": "*",
2727
"cboden/ratchet": "^0.4.1",
2828
"clue/buzz-react": "^2.5",
29+
"facade/ignition-contracts": "^1.0",
2930
"guzzlehttp/psr7": "^1.5",
30-
"illuminate/broadcasting": "5.7.* || 5.8.*",
31-
"illuminate/console": "5.7.* || 5.8.*",
32-
"illuminate/http": "5.7.* || 5.8.*",
33-
"illuminate/routing": "5.7.* || 5.8.*",
34-
"illuminate/support": "5.7.* || 5.8.*",
31+
"illuminate/broadcasting": "5.7.* || 5.8.* || ^6.0",
32+
"illuminate/console": "5.7.* || 5.8.* || ^6.0",
33+
"illuminate/http": "5.7.* || 5.8.* || ^6.0",
34+
"illuminate/routing": "5.7.* || 5.8.* || ^6.0",
35+
"illuminate/support": "5.7.* || 5.8.* || ^6.0",
3536
"pusher/pusher-php-server": "~3.0 || ~4.0",
37+
"react/dns": "^1.1",
3638
"symfony/http-kernel": "~4.0",
37-
"symfony/psr-http-message-bridge": "^1.1",
38-
"react/dns": "^1.1"
39+
"symfony/psr-http-message-bridge": "^1.1"
3940
},
4041
"require-dev": {
4142
"mockery/mockery": "^1.2",
42-
"orchestra/testbench": "3.7.* || 3.8.*",
43-
"phpunit/phpunit": "^7.0"
43+
"orchestra/testbench": "3.7.* || 3.8.* || ^4.0",
44+
"phpunit/phpunit": "^7.0 || ^8.0"
4445
},
4546
"autoload": {
4647
"psr-4": {

src/Exceptions/InvalidApp.php

+13-1
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,11 @@
33
namespace BeyondCode\LaravelWebSockets\Exceptions;
44

55
use Exception;
6+
use Facade\IgnitionContracts\Solution;
7+
use Facade\IgnitionContracts\BaseSolution;
8+
use Facade\IgnitionContracts\ProvidesSolution;
69

7-
class InvalidApp extends Exception
10+
class InvalidApp extends Exception implements ProvidesSolution
811
{
912
public static function notFound($appId)
1013
{
@@ -15,4 +18,13 @@ public static function valueIsRequired($name, $appId)
1518
{
1619
return new static("{$name} is required but was empty for app id `{$appId}`.");
1720
}
21+
22+
public function getSolution(): Solution
23+
{
24+
return BaseSolution::create('Your application id could not be found')
25+
->setSolutionDescription('Make sure that your `config/websockets.php` contains the app key you are trying to use.')
26+
->setDocumentationLinks([
27+
'Configuring WebSocket Apps (official documentation)' => 'https://docs.beyondco.de/laravel-websockets/1.0/basic-usage/pusher.html#configuring-websocket-apps',
28+
]);
29+
}
1830
}

0 commit comments

Comments
 (0)