snooze
snooze copied to clipboard
Add Multiple Notifiables
Hi,
i was raised an issue #94 using my other account @aneesdev.. i made this pr to be able to create many scheduled notifications just like laravel Notification facade. so there is createMany method for multiple notifiables.
$enrolledUsers = User::whereRelation('enrolledCourses', 'course_id', $course_id)->get();
ScheduledNotification::createMany(
$enrolledUsers, // Target
new NewLessonNotification($lesson), // Notification
Carbon::createFromFormat('d/m/Y h:i a', $request->scheduled_at) // Send At
);
@thomasjohnkane
@atymic
@thomasjohnkane package dead?
@atymic will this be merged ever or not?
Could you bring this up to date and add some tests to ensure no BC breaks please?
Codecov Report
Attention: Patch coverage is 0% with 28 lines in your changes are missing coverage. Please review.
Project coverage is 87.66%. Comparing base (
7efbf33) to head (57774df).
:exclamation: Current head 57774df differs from pull request most recent head 8090880. Consider uploading reports for the commit 8090880 to get more accurate results
| Files | Patch % | Lines |
|---|---|---|
| src/ScheduledNotification.php | 0.00% | 28 Missing :warning: |
:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@ Coverage Diff @@
## master #95 +/- ##
============================================
- Coverage 96.42% 87.66% -8.77%
- Complexity 88 97 +9
============================================
Files 10 10
Lines 280 308 +28
============================================
Hits 270 270
- Misses 10 38 +28
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
@atymic it's been 2 years 😅... but I updated the original PR description, there is a new method createMany which does the same as the create method on the ScheduledNotification class but for multiple notifiables.
as for the Breaking change, I think there will be none as this just introduces the new createMany method and does not modify any existing create method, plus the existing tests seems to be passing 😃