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

NotificationWatcher formatNotifiable TypeError #1372

Closed
yangjisen opened this issue Aug 10, 2023 · 1 comment
Closed

NotificationWatcher formatNotifiable TypeError #1372

yangjisen opened this issue Aug 10, 2023 · 1 comment

Comments

@yangjisen
Copy link

Telescope Version

4.16.0

Laravel Version

10.18.0

PHP Version

8.1.4

Database Driver & Version

8.0.27

Description

      $params = [[
            'title' => 'title',
            'text' => 'text',
        ]];

        Notification::send($params, new InvoicePaid($invoice));

TypeError: get_class(): Argument #1 ($object) must be of type object, array given

private function formatNotifiable($notifiable)
{
if ($notifiable instanceof Model) {
return FormatModel::given($notifiable);
} elseif ($notifiable instanceof AnonymousNotifiable) {
$routes = array_map(function ($route) {
return is_array($route) ? implode(',', $route) : $route;
}, $notifiable->routes);
return 'Anonymous:'.implode(',', $routes);
}
return get_class($notifiable);
}

Steps To Reproduce

Provide detailed steps to reproduce your issue. If necessary, please provide a GitHub repository to demonstrate your issue using laravel new bug-report --github="--public".

@crynobone crynobone added the bug label Aug 10, 2023
@nunomaduro
Copy link
Member

Apologies - could you please recreate this issue with a more detailed description? I'm finding it difficult to grasp the issue as described here and how to reproduce it. Sorry!

@crynobone crynobone removed the bug label Sep 17, 2023
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

3 participants