ManagesEvents
trait ManagesEvents
Methods
Register multiple view composers via an array.
Add an event for a given view.
Register a class based view composer.
Build a class based container callback Closure.
Parse a class based composer name.
Determine the class event method based on the given prefix.
Details
at line 19
array
creator(array|string $views, Closure|string $callback)
Register a view creator event.
Boot-only. The listener persists on the singleton View Factory's event dispatcher for the worker lifetime and affects every subsequent request.
at line 36
array
composers(array $composers)
Register multiple view composers via an array.
Boot-only. The listeners persist on the singleton View Factory's event dispatcher for the worker lifetime and affect every subsequent request.
at line 53
array
composer(array|string $views, Closure|string $callback)
Register a view composer event.
Boot-only. The listener persists on the singleton View Factory's event dispatcher for the worker lifetime and affects every subsequent request.
at line 67
protected Closure|null
addViewEvent(string $view, Closure|string $callback, string $prefix = 'composing: ')
Add an event for a given view.
at line 83
protected Closure
addClassEvent(string $view, string $class, string $prefix)
Register a class based view composer.
at line 103
protected Closure
buildClassEventCallback(string $class, string $prefix)
Build a class based container callback Closure.
at line 118
protected array
parseClassEvent(string $class, string $prefix)
Parse a class based composer name.
at line 126
protected string
classEventMethodForPrefix(string $prefix)
Determine the class event method based on the given prefix.
at line 134
protected void
addEventListener(string $name, Closure $callback)
Add a listener to the event dispatcher.
at line 148
void
callComposer(View $view)
Call the composer for a given view.
at line 158
void
callCreator(View $view)
Call the creator for a given view.