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

Bulk/Multiple notifiables #94

Open
aneesdev opened this issue Oct 30, 2021 · 2 comments
Open

Bulk/Multiple notifiables #94

aneesdev opened this issue Oct 30, 2021 · 2 comments

Comments

@aneesdev
Copy link

aneesdev commented Oct 30, 2021

Hi,

first of all thank you so much for creating this package.. does this package support bulk, multiple notifiables? just like laravel Notification::send()

if($request->schedule && !empty($request->scheduled_at))
{
    $enrolledUsers = User::whereRelation('enrolledCourses', 'course_id', $course_id)->get();

    ScheduledNotification::create(
        $enrolledUsers, // Target
        new NewLessonNotification($lesson), // Notification
        Carbon::createFromFormat('d/m/Y h:i a', $request->scheduled_at) // Send At
   ); // gives me error: Collection is not notifiable..

} else {

    $enrolledUsers = User::whereRelation('enrolledCourses', 'course_id', $course_id)->get();
    
    Notification::send($enrolledUsers, new NewLessonNotification($lesson));
}
@aneesdev
Copy link
Author

@thomasjohnkane

@aneesdev aneesdev changed the title Bulk/Multiple scheduled notification Bulk/Multiple notifiables Oct 30, 2021
@aneeskhan47
Copy link

#95

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