master

laravel/framework

Last updated at: 29/12/2023 09:21

Dispatcher.php

TLDR

This file contains an interface named Dispatcher which defines two methods for sending notifications: send and sendNow.

Methods

send

This method sends the given notification to the given notifiable entities. The notifiable entities can be passed as a Collection, an array, or a single entity. The notification can be of any type. This method does not return any value.

sendNow

This method sends the given notification immediately. Similar to send, the notifiable entities can be passed as a Collection, an array, or a single entity. The notification can be of any type. Optionally, an array of channels to send the notification through can also be provided. This method does not return any value.

<?php

namespace Illuminate\Contracts\Notifications;

interface Dispatcher
{
    /**
     * Send the given notification to the given notifiable entities.
     *
     * @param  \Illuminate\Support\Collection|array|mixed  $notifiables
     * @param  mixed  $notification
     * @return void
     */
    public function send($notifiables, $notification);

    /**
     * Send the given notification immediately.
     *
     * @param  \Illuminate\Support\Collection|array|mixed  $notifiables
     * @param  mixed  $notification
     * @param  array|null  $channels
     * @return void
     */
    public function sendNow($notifiables, $notification, array $channels = null);
}