Skip to content

Commit a150a7d

Browse files
committed
allow multiple views to be registered for a single composer.
1 parent d142894 commit a150a7d

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

laravel/view.php

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -250,13 +250,18 @@ public static function name($view, $name)
250250
* });
251251
* </code>
252252
*
253-
* @param string $view
254-
* @param Closure $composer
253+
* @param string|array $view
254+
* @param Closure $composer
255255
* @return void
256256
*/
257-
public static function composer($view, $composer)
257+
public static function composer($views, $composer)
258258
{
259-
Event::listen("laravel.composing: {$view}", $composer);
259+
$views = (array) $views;
260+
261+
foreach ($views as $view)
262+
{
263+
Event::listen("laravel.composing: {$view}", $composer);
264+
}
260265
}
261266

262267
/**

0 commit comments

Comments
 (0)