Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Argument #1 ($result) must be of type array, Aws\Result given #19

Open
Caceres-Joseph opened this issue Mar 18, 2022 · 1 comment
Open

Comments

@Caceres-Joseph
Copy link

Hi @georgeboot

I have created a route for call the broadcast like this

# web.php

Route::get('/broadcast', function () {
    broadcast(new Hello());
});

This is my event

/app/Events/Hello.php

<?php

namespace App\Events;

use Illuminate\Broadcasting\Channel;
use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Broadcasting\PresenceChannel;
use Illuminate\Broadcasting\PrivateChannel;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Queue\SerializesModels;

class Hello implements ShouldBroadcast
{
    use Dispatchable, InteractsWithSockets, SerializesModels;

    /**
     * Create a new event instance.
     *
     * @return void
     */
    public function __construct()
    {
        //
    }

    public function broadcastWith()
    {
        return [
            'hello' => 'hi there'
        ];
    }

    /**
     * Get the channels the event should broadcast on.
     *
     * @return \Illuminate\Broadcasting\Channel|array
     */
    public function broadcastOn()
    {
        return new Channel('channel');
    }
}

I already checked that the lambda has permissions for the DynamoDB table but I noticed that the Dynamo table is empty, that could be why I get this error when calling the event

image

Do you know what could be?

Thanks

@NairanOmura
Copy link

NairanOmura commented Mar 25, 2022

Hello,

I had the same problem and i opened a pull-request to resolve this... #20

the return of AWS library is "/Aws/Result", this package accepts only "array".
to resolve temporarily in my projects i add the following command in my pipelines:

sed -i 's,(array $result):\ array,($result),g' vendor/georgeboot/laravel-echo-api-gateway/src/SubscriptionRepository.php

this solved it for me until it fixed it definitively

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants