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

push checks to see if $notifiable is an array #1

Closed
csuarezgfx opened this issue Jun 9, 2016 · 3 comments
Closed

push checks to see if $notifiable is an array #1

csuarezgfx opened this issue Jun 9, 2016 · 3 comments

Comments

@csuarezgfx
Copy link

Unfortunately, I am feeding it a Collection of users. So I altered:

if ( ! is_array($notifiable) ) {
        $notifiable = [$notifiable];
}

to:

if ((! is_array($notifiable)) && ! ($notifiable instanceof Collection)) {
    $notifiable = [$notifiable];
}
``
@michaeljennings
Copy link
Owner

Good spot! I've changed your solution slightly by checking if the notifiable class is traversable. This will just check that it is a class that can go through a loop. This should be fixed in the v0.1.3. Let me know if you're still having issues with it.

@csuarezgfx
Copy link
Author

Hi
$notifiable instanceof Traversable
produces previous error, changed to:
$notifiable instanceof \Traversable

@michaeljennings
Copy link
Owner

Hi have you pulled in the latest update? I believe I used the Traversable interface at the top so that should be working? If it's not let me know and I'll fix it.

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