laravel / telescope

An elegant debug assistant for the Laravel framework.

Home Page:https://laravel.com/docs/telescope

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NotificationWatcher formatNotifiable TypeError

yangjisen opened this issue · comments

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".

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!