Skip to content

Commit e21ea87

Browse files
authored
Merge pull request #29 from jp-davy/feature/laravel-5-4-compatibility-blade-compiler
Feature/laravel 5 4 compatibility blade compiler
2 parents cfb38a9 + 414259c commit e21ea87

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/Flynsarmy/DbBladeCompiler/DbBladeCompiler.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ public function __construct($filesystem, $cache_path, Repository $config)
1717
$blade = app('view')->getEngineResolver()->resolve('blade')->getCompiler();
1818

1919
parent::__construct($filesystem, $cache_path);
20-
$this->rawTags = $blade->getRawTags();
21-
$this->contentTags = $blade->getContentTags();
22-
$this->escapedTags = $blade->getEscapedContentTags();
20+
$this->rawTags = $blade->rawTags;
21+
$this->contentTags = array_map('stripcslashes', $blade->contentTags);
22+
$this->escapedTags = array_map('stripcslashes', $blade->escapedTags);
2323
$this->extensions = $blade->getExtensions();
2424
$this->customDirectives = $blade->getCustomDirectives();
2525
$this->config = $config;

src/Flynsarmy/DbBladeCompiler/DbView.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public function render(Closure $callback = null)
7474
// Once we have the contents of the view, we will flush the sections if we are
7575
// done rendering all views so that there is nothing left hanging over when
7676
// anothoer view is rendered in the future by the application developers.
77-
View::flushSectionsIfDoneRendering();
77+
( str_contains( app()->version(), ['5.3','5.2', '5.1']) ? View::flushSectionsIfDoneRendering() : View::flushStateIfDoneRendering());
7878

7979
return $response ?: $contents;
8080
}

0 commit comments

Comments
 (0)