The method toApiNotification() does not exist on Illuminate\Notifications\Notification. It seems like you code against a sub-type of Illuminate\Notifications\Notification such as Andreshg112\PusherApiNot...s\Test\TestNotification.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the ignore-call annotation