Add Laravel 6 support and ignition solution

This commit is contained in:
Marcel Pociot 2019-09-04 08:45:21 +02:00
parent 0ffc19a5f5
commit 74c3e06ece
3 changed files with 25 additions and 11 deletions

3
.gitignore vendored
View File

@ -2,4 +2,5 @@ build
composer.lock
docs
vendor
coverage
coverage
.phpunit.result.cache

View File

@ -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": {

View File

@ -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',
]);
}
}