diff --git a/src/Utilities/Helper.php b/src/Utilities/Helper.php index f8c0a8fe..3425d391 100644 --- a/src/Utilities/Helper.php +++ b/src/Utilities/Helper.php @@ -61,7 +61,16 @@ public static function compileContent($content, array $data, $param) { if (is_string($content)) { return static::compileBlade($content, static::getMixedValue($data, $param)); - } elseif (is_callable($content)) { + } + + if (is_callable($content)) { + $reflection = new \ReflectionFunction($content); + $arguments = $reflection->getParameters(); + + if (count($arguments) > 0) { + return app()->call($content, [$arguments[0]->name => $param]); + } + return $content($param); }