1
1
# laravel-echo-api-gateway
2
2
3
- [ ![ CI] ( https://github.com/georgeboot /laravel-echo-api-gateway/workflows/CI/badge.svg?event=push )] ( https://github.com/georgeboot /laravel-echo-api-gateway/actions?query=workflow%3ACI )
4
- [ ![ codecov] ( https://codecov.io/gh/georgeboot /laravel-echo-api-gateway/branch/master/graph/badge.svg?token=UVIA3FBQPP )] ( https://codecov.io/gh/georgeboot /laravel-echo-api-gateway )
3
+ [ ![ CI] ( https://github.com/aliasproject /laravel-echo-api-gateway/workflows/CI/badge.svg?event=push )] ( https://github.com/aliasproject /laravel-echo-api-gateway/actions?query=workflow%3ACI )
4
+ [ ![ codecov] ( https://codecov.io/gh/aliasproject /laravel-echo-api-gateway/branch/master/graph/badge.svg?token=UVIA3FBQPP )] ( https://codecov.io/gh/aliasproject /laravel-echo-api-gateway )
5
5
6
6
## Not maintained!!!
7
+
7
8
I currently don't have the time to maintain this package.
8
9
9
10
My recommendation is to use Soketi serverless instead: https://renoki-25232877.hubspotpagebuilder.eu/soketi-serverless
@@ -29,11 +30,11 @@ advised to only use this package for non-critical / non-production projects.
29
30
30
31
In order to use this package, your project needs to meet the following criteria:
31
32
32
- - PHP 7.4 or 8.x
33
- - Laravel 6, 7 or 8
34
- - Uses either [ bref] ( https://bref.sh ) or [ Laravel Vapor] ( https://vapor.laravel.com ) to deploy to AWS
35
- - Has a working queue
36
- - Uses Laravel Mix or any other tool to bundle your assets
33
+ - PHP 7.4 or 8.x
34
+ - Laravel 6, 7 or 8
35
+ - Uses either [ bref] ( https://bref.sh ) or [ Laravel Vapor] ( https://vapor.laravel.com ) to deploy to AWS
36
+ - Has a working queue
37
+ - Uses Laravel Mix or any other tool to bundle your assets
37
38
38
39
## Installation
39
40
@@ -42,7 +43,7 @@ Installation of this package is fairly simply.
42
43
First we have to install both the composer and npm package:
43
44
44
45
``` shell
45
- composer require georgeboot /laravel-echo-api-gateway
46
+ composer require aliasproject /laravel-echo-api-gateway
46
47
47
48
yarn add laravel-echo-api-gateway
48
49
# or
@@ -115,10 +116,18 @@ provider:
115
116
iamRoleStatements:
116
117
# Add this iamRoleStatement
117
118
- Effect: Allow
118
- Action: [ dynamodb:Query, dynamodb:GetItem, dynamodb:PutItem, dynamodb:UpdateItem, dynamodb:DeleteItem, dynamodb:BatchWriteItem ]
119
+ Action:
120
+ [
121
+ dynamodb:Query,
122
+ dynamodb:GetItem,
123
+ dynamodb:PutItem,
124
+ dynamodb:UpdateItem,
125
+ dynamodb:DeleteItem,
126
+ dynamodb:BatchWriteItem,
127
+ ]
119
128
Resource:
120
129
- !GetAtt ConnectionsTable.Arn
121
- - !Join [ '' , [ !GetAtt ConnectionsTable.Arn, ' /index/*' ] ]
130
+ - !Join ["" , [!GetAtt ConnectionsTable.Arn, " /index/*"] ]
122
131
` ` `
123
132
124
133
Add an environment variable to autogenerate our websocket URL :
@@ -140,13 +149,13 @@ Next, create the PHP handler file in `handlers/websocket.php`
140
149
` ` ` php
141
150
<?php
142
151
143
- use Georgeboot \L aravelEchoApiGateway\H andler;
152
+ use AliasProject \L aravelEchoApiGateway\H andler;
144
153
use Illuminate\F oundation\A pplication;
145
154
146
- require __DIR__ . ' /../vendor/autoload.php' ;
155
+ require __DIR__ . " /../vendor/autoload.php" ;
147
156
148
157
/** @var Application $app */
149
- $app = require __DIR__ . ' /../bootstrap/app.php' ;
158
+ $app = require __DIR__ . " /../bootstrap/app.php" ;
150
159
151
160
$kernel = $app->make(Illuminate\C ontracts\C onsole\K ernel::class);
152
161
$kernel->bootstrap();
@@ -198,13 +207,13 @@ LARAVEL_ECHO_API_GATEWAY_API_STAGE=your-api-stage-name
198
207
Add to your javascript file :
199
208
200
209
` ` ` js
201
- import Echo from ' laravel-echo' ;
202
- import {broadcaster} from ' laravel-echo-api-gateway' ;
210
+ import Echo from " laravel-echo" ;
211
+ import { broadcaster } from " laravel-echo-api-gateway" ;
203
212
204
213
window.Echo = new Echo({
205
214
broadcaster,
206
215
// replace the placeholders
207
- host: ' wss://{api-ip}.execute-api.{region}.amazonaws.com/{stage}' ,
216
+ host: " wss://{api-ip}.execute-api.{region}.amazonaws.com/{stage}" ,
208
217
});
209
218
` ` `
210
219
0 commit comments