/
githubmirror
/
framework
Обзор
Документация
Войти
/
githubmirror
/
framework
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
13.x
src/Illuminate/Foundation/Events/Dispatchable.php
56 строк
1 KB
Pedro Oliveira
Add support for named arguments in event dispatching and broadcasting (#59075)
04 мар 2026, 12:12
Не верифицирован
04 мар 2026, 12:12
16f3ae3
Код
Авторство
О чём код?
<?php namespace Illuminate\Foundation\Events; trait Dispatchable { /** * Dispatch the event with the given arguments. * * @param mixed ...$arguments * @return mixed */ public static function dispatch(...$arguments) { return event(new static(...$arguments)); } /** * Dispatch the event with the given arguments if the given truth test passes. * * @param bool $boolean * @param mixed ...$arguments * @return mixed */ public static function dispatchIf($boolean, ...$arguments) { if ($boolean) { return event(new static(...$arguments)); } } /** * Dispatch the event with the given arguments unless the given truth test passes. * * @param bool $boolean * @param mixed ...$arguments * @return mixed */ public static function dispatchUnless($boolean, ...$arguments) { if (! $boolean) { return event(new static(...$arguments)); } } /** * Broadcast the event with the given arguments. * * @param mixed ...$arguments * @return \Illuminate\Broadcasting\PendingBroadcast */ public static function broadcast(...$arguments) { return broadcast(new static(...$arguments)); } }