laravel-notification-channels / twilio

Twilio notifications channel for Laravel

Home Page:https://laravel-notification-channels.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bug? Unhandled match case on $driver in Laravel 9

jeffreyvanhees opened this issue · comments

Versions: Laravel 9.0, latest version of this package.

When sending a notification I git the "Unhandled match case"-error. It occurred in  
Illuminate / Notifications / RoutesNotifications.php on line 46.

It's trying to match the driver but it was not found:

public function routeNotificationFor($driver, $notification = null)
    {
        if (method_exists($this, $method = 'routeNotificationFor'.Str::studly($driver))) {
            return $this->{$method}($notification);
        }

       // Error occurred here:
        return match ($driver) {
            'database' => $this->notifications(),
            'mail' => $this->email,
        };
    }

I did everything according to the documentation. The notifiable model contains a routeNotificationForTwilio(), but $method = 'routeNotificationFor'.Str::studly($driver) returns "routeNotificationForNotificationChannels\Twilio\TwilioChannel" and I believe that's why the driver cannot be found.

After upgrading from 9.0 -> 9.4 it works again. Perhaps this was already known to you, but it might be good to take this into account in the minimal dependencies. :)

Thanks for the package!