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

Notification Event #465

Open
connor-devuk opened this issue Jan 10, 2025 · 1 comment
Open

Notification Event #465

connor-devuk opened this issue Jan 10, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@connor-devuk
Copy link

What were you trying to do?

I'm trying to make a notfication have a custom click event: Notification::title('Team Call')
->message('Hey just a little reminder a team call is about to start!')
->event(\App\Events\OpenTeamCallEvent::class)
->show(); like so however when clicking it an internal server error happens

Only arrays and Traversables can be unpacked

This seems to be related to livewire however no variables should be passed so not too sure whats going on

This is my event

<?php

namespace App\Events;

use Illuminate\Broadcasting\Channel;
use Illuminate\Contracts\Broadcasting\ShouldBroadcastNow;

class OpenTeamCallEvent implements ShouldBroadcastNow
{
    public function broadcastOn(): array
    {
        return [
            new Channel('nativephp')
        ];
    }
}

What happened?

Clicking an event from a notification it throws the error Only arrays and Traversables can be unpacked

How to reproduce the bug

Notification::title('Team Call')
->message('Hey just a little reminder a team call is about to start!')
->event(\App\Events\OpenTeamCallEvent::class)
->show();

Package Versions

{
"installed": [
{
"name": "nativephp/electron",
"direct-dependency": true,
"homepage": "https://github.com/nativephp/electron",
"source": "https://github.com/NativePHP/electron/tree/0.9.0",
"version": "0.9.0",
"description": "Electron wrapper for the NativePHP framework.",
"abandoned": false
},
{
"name": "nativephp/laravel",
"direct-dependency": false,
"homepage": "https://github.com/nativephp/laravel",
"source": "https://github.com/NativePHP/laravel/tree/0.7.0",
"version": "0.7.0",
"description": "Laravel wrapper for the NativePHP framework.",
"abandoned": false
},
{
"name": "nativephp/php-bin",
"direct-dependency": false,
"homepage": "https://nativephp.com",
"source": "https://github.com/NativePHP/php-bin/tree/0.5.6",
"version": "0.5.6",
"description": "PHP binaries used by the NativePHP framework",
"abandoned": false
}
]
}

PHP Version

8.3

Laravel Version

11.37

Node Version

22.11.0

Which operating systems have you seen this occur on?

macOS

OS version

15.1 (24B83)

Notes

No response

@connor-devuk connor-devuk added the bug Something isn't working label Jan 10, 2025
@connor-devuk
Copy link
Author

its worth noting when i call this event from a controller or my scheduler etc it works, its only when its called via the Notfication->event method

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant