snooze icon indicating copy to clipboard operation
snooze copied to clipboard

Add Multiple Notifiables

Open aneeskhan47 opened this issue 4 years ago • 7 comments

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
   ); 

aneeskhan47 avatar Oct 30 '21 05:10 aneeskhan47

@thomasjohnkane

aneeskhan47 avatar Oct 30 '21 05:10 aneeskhan47

@atymic

aneeskhan47 avatar Oct 30 '21 05:10 aneeskhan47

@thomasjohnkane package dead?

aneesdev avatar Apr 02 '22 10:04 aneesdev

@atymic will this be merged ever or not?

aneeskhan47 avatar Aug 11 '22 15:08 aneeskhan47

Could you bring this up to date and add some tests to ensure no BC breaks please?

atymic avatar Mar 20 '24 01:03 atymic

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.

codecov-commenter avatar Mar 20 '24 01:03 codecov-commenter

@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 😃

aneeskhan47 avatar Mar 25 '24 19:03 aneeskhan47