UseMuffin/Slug

FindSlugged should check for isset instead of empty

jorgeandrescastro opened this issue · 2 comments

Hello, I have realized that the findSlugged finder checks empty for the slug key:
https://github.com/UseMuffin/Slug/blob/master/src/Model/Behavior/SlugBehavior.php#L231-L233
Thus, if the slug key is a 0, it will throw an
InvalidArgumentException('The 'slug' key is required by the 'slugged' finder.');
which I believe is the wrong behavior, since a slug is being supplied; shouldn't it check for is_null or isset?
What do you think?
Thanks

Any updates here? I could provide a fix.

jadb commented

@steefaan go for it!