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

"App\Models\User is not notifiable" error #76

Closed
lorenzosfarra opened this issue Jun 1, 2021 · 1 comment
Closed

"App\Models\User is not notifiable" error #76

lorenzosfarra opened this issue Jun 1, 2021 · 1 comment

Comments

@lorenzosfarra
Copy link

Hi,

thanks a lot for your amazing work.

I would like to understand the given error. According to the documentation in the README file, I should have a Model like this:

class User extends Model {
    use SnoozeNotifiable;

    // ...
}

that sadly fires the error in the issue subject.

If look closer, the error is thrown in lines 46-48 of ScheduledNotification.php:

if (! method_exists($notifiable, 'notify')) {
        throw new SchedulingFailedException(sprintf('%s is not notifiable', get_class($notifiable)));
}

if fact, looking at Traits/SnoozeNotifiable.php I see that only the notifyAt method is declared, but not notify.

The error disappear if I declare the Model as

    use Notifiable, SnoozeNotifiable;

    // ...
}

Anyway I would like to know if there's a mistake somewhere in my code, or "simply" something to add in the README.

version "1.0.5"
Laravel "v6.20.27"

@atymic
Copy link
Collaborator

atymic commented Sep 10, 2021

Good catch, docs updated :)

@atymic atymic closed this as completed Sep 10, 2021
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

2 participants