From 74c3e06ece566b967aa5bec00f82c8b2d4da07fb Mon Sep 17 00:00:00 2001 From: Marcel Pociot Date: Wed, 4 Sep 2019 08:45:21 +0200 Subject: [PATCH] Add Laravel 6 support and ignition solution --- .gitignore | 3 ++- composer.json | 19 ++++++++++--------- src/Exceptions/InvalidApp.php | 14 +++++++++++++- 3 files changed, 25 insertions(+), 11 deletions(-) diff --git a/.gitignore b/.gitignore index 808f8c5..e45efd8 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ build composer.lock docs vendor -coverage \ No newline at end of file +coverage +.phpunit.result.cache \ No newline at end of file diff --git a/composer.json b/composer.json index 798e710..87aa7ba 100644 --- a/composer.json +++ b/composer.json @@ -26,21 +26,22 @@ "ext-json": "*", "cboden/ratchet": "^0.4.1", "clue/buzz-react": "^2.5", + "facade/ignition-contracts": "^1.0", "guzzlehttp/psr7": "^1.5", - "illuminate/broadcasting": "5.7.* || 5.8.*", - "illuminate/console": "5.7.* || 5.8.*", - "illuminate/http": "5.7.* || 5.8.*", - "illuminate/routing": "5.7.* || 5.8.*", - "illuminate/support": "5.7.* || 5.8.*", + "illuminate/broadcasting": "5.7.* || 5.8.* || ^6.0", + "illuminate/console": "5.7.* || 5.8.* || ^6.0", + "illuminate/http": "5.7.* || 5.8.* || ^6.0", + "illuminate/routing": "5.7.* || 5.8.* || ^6.0", + "illuminate/support": "5.7.* || 5.8.* || ^6.0", "pusher/pusher-php-server": "~3.0 || ~4.0", + "react/dns": "^1.1", "symfony/http-kernel": "~4.0", - "symfony/psr-http-message-bridge": "^1.1", - "react/dns": "^1.1" + "symfony/psr-http-message-bridge": "^1.1" }, "require-dev": { "mockery/mockery": "^1.2", - "orchestra/testbench": "3.7.* || 3.8.*", - "phpunit/phpunit": "^7.0" + "orchestra/testbench": "3.7.* || 3.8.* || ^4.0", + "phpunit/phpunit": "^7.0 || ^8.0" }, "autoload": { "psr-4": { diff --git a/src/Exceptions/InvalidApp.php b/src/Exceptions/InvalidApp.php index 1d20402..8a4ecff 100644 --- a/src/Exceptions/InvalidApp.php +++ b/src/Exceptions/InvalidApp.php @@ -3,8 +3,11 @@ namespace BeyondCode\LaravelWebSockets\Exceptions; use Exception; +use Facade\IgnitionContracts\Solution; +use Facade\IgnitionContracts\BaseSolution; +use Facade\IgnitionContracts\ProvidesSolution; -class InvalidApp extends Exception +class InvalidApp extends Exception implements ProvidesSolution { public static function notFound($appId) { @@ -15,4 +18,13 @@ class InvalidApp extends Exception { return new static("{$name} is required but was empty for app id `{$appId}`."); } + + public function getSolution(): Solution + { + return BaseSolution::create('Your application id could not be found') + ->setSolutionDescription('Make sure that your `config/websockets.php` contains the app key you are trying to use.') + ->setDocumentationLinks([ + 'Configuring WebSocket Apps (official documentation)' => 'https://docs.beyondco.de/laravel-websockets/1.0/basic-usage/pusher.html#configuring-websocket-apps', + ]); + } }