master

laravel/framework

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

Factory.php

TLDR

This file defines the Factory interface within the Illuminate\Contracts\Notifications namespace. The interface declares three methods: channel, send, and sendNow.

Methods

channel

This method retrieves a channel instance by its name. It accepts an optional name parameter and returns the channel instance.

send

This method sends the given notification to the given notifiable entities. It accepts notifiables (a collection, array, or single instance), and the notification to be sent. This method does not return any value.

sendNow

Similar to the send method, this method sends the given notification immediately. It also accepts notifiables and the notification to be sent. This method does not return any value.

<?php

namespace Illuminate\Contracts\Notifications;

interface Factory
{
    /**
     * Get a channel instance by name.
     *
     * @param  string|null  $name
     * @return mixed
     */
    public function channel($name = null);

    /**
     * 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
     * @return void
     */
    public function sendNow($notifiables, $notification);
}