From 1dfd6f4b39eb9cd208efcffd3348cf031827fbdf Mon Sep 17 00:00:00 2001 From: Marek Gogol <9mike66@gmail.com> Date: Sat, 22 Dec 2018 16:05:26 +0100 Subject: [PATCH] added option in blade extractor for using blade facade instead of blade compiler --- src/Extractors/Blade.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Extractors/Blade.php b/src/Extractors/Blade.php index 2437e9ac..3c8c9da0 100644 --- a/src/Extractors/Blade.php +++ b/src/Extractors/Blade.php @@ -16,9 +16,13 @@ class Blade extends Extractor implements ExtractorInterface */ public static function fromString($string, Translations $translations, array $options = []) { - $cachePath = empty($options['cachePath']) ? sys_get_temp_dir() : $options['cachePath']; - $bladeCompiler = new BladeCompiler(new Filesystem(), $cachePath); - $string = $bladeCompiler->compileString($string); + if (empty($options['facade'])) { + $cachePath = empty($options['cachePath']) ? sys_get_temp_dir() : $options['cachePath']; + $bladeCompiler = new BladeCompiler(new Filesystem(), $cachePath); + $string = $bladeCompiler->compileString($string); + } else { + $string = $options['facade']::compileString($string); + } PhpCode::fromString($string, $translations, $options); }