Closed Xammie closed 1 year ago
@shanedeakin could you test to see if this solves your problem? You can install it with:
composer require --dev xammie/mailbook dev-add-notifiable
I'm not 100% sure about the name of the method. Thinking of maybe using to
instead. Here are some example ideas of using this method.
Mailbook::to($user)->add(Mailable::class);
Mailbook::to(fn () => User::factory()->create())
->add(function () {
return new Mailable();
});
Mailbook::to($user, function () {
Mailbook::add(Mailable::class):
Mailbook::add(Verification::class):
});
Mailbook::to($user)->group(function () {
Mailbook::add(Mailable::class):
Mailbook::add(Verification::class):
});
::to($user)
::via($admin)
::notifiable($manager)
::for($user)
Yes, this definitely solves the issue for me. I agree that one of the alternate method names provided might be better suited for this.
Is the group()
method still just an idea at this point? I just went to test it, but can't see it.
Everything is looking great as far as I can see 👍
Thanks for testing it.
Yeah the group method is an idea and not (yet) implemented.
@shanedeakin This has been released in 1.6.0 :)
Thanks to #40 for the idea