From d759ea3de086a99629905134fdf04338474d133c Mon Sep 17 00:00:00 2001 From: Kennedy Tedesco Date: Mon, 13 Mar 2017 13:16:42 -0300 Subject: [PATCH] [5.4] Brings back to app() the ability to make instances passing parameters Following: https://github.com/laravel/framework/pull/18271 --- src/Illuminate/Foundation/helpers.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Illuminate/Foundation/helpers.php b/src/Illuminate/Foundation/helpers.php index c111e0db51ce..04ddf181869a 100644 --- a/src/Illuminate/Foundation/helpers.php +++ b/src/Illuminate/Foundation/helpers.php @@ -94,15 +94,18 @@ function action($name, $parameters = [], $absolute = true) * Get the available container instance. * * @param string $abstract + * @param array $parameters * @return mixed|\Illuminate\Foundation\Application */ - function app($abstract = null) + function app($abstract = null, array $parameters = []) { if (is_null($abstract)) { return Container::getInstance(); } - return Container::getInstance()->make($abstract); + return empty($parameters) + ? Container::getInstance()->make($abstract) + : Container::getInstance()->makeWith($abstract, $parameters); } }