Skip to content

Commit e5e6366

Browse files
MarekGogoloscarotero
authored andcommitted
added option in blade extractor for using blade facade instead of blade compiler (#198)
1 parent 545f716 commit e5e6366

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

src/Extractors/Blade.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,13 @@ class Blade extends Extractor implements ExtractorInterface
1616
*/
1717
public static function fromString($string, Translations $translations, array $options = [])
1818
{
19-
$cachePath = empty($options['cachePath']) ? sys_get_temp_dir() : $options['cachePath'];
20-
$bladeCompiler = new BladeCompiler(new Filesystem(), $cachePath);
21-
$string = $bladeCompiler->compileString($string);
19+
if (empty($options['facade'])) {
20+
$cachePath = empty($options['cachePath']) ? sys_get_temp_dir() : $options['cachePath'];
21+
$bladeCompiler = new BladeCompiler(new Filesystem(), $cachePath);
22+
$string = $bladeCompiler->compileString($string);
23+
} else {
24+
$string = $options['facade']::compileString($string);
25+
}
2226

2327
PhpCode::fromString($string, $translations, $options);
2428
}

0 commit comments

Comments
 (0)