File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -88,6 +88,21 @@ private function replaceBladeHTMLWithBladeDirectives($string){
88
88
$ string = str_replace ('<ifGuest> ' , '@guest ' , $ string );
89
89
$ string = str_replace ('</ifGuest> ' , '@endguest ' , $ string );
90
90
91
+ // trim any curly brace from {{ array.item }} to {{ $array->item }}
92
+ $ bladeCurlyBraceMatches = [];
93
+ preg_match_all ('/{{(.*?)}}/ ' , $ string , $ bladeCurlyBraceMatches );
94
+ foreach ($ bladeCurlyBraceMatches [1 ] as $ index => $ curlyBrace ){
95
+ $ trimmedContent = trim ($ curlyBrace );
96
+ // dd($trimmedContent[0]);
97
+ if (isset ($ trimmedContent [0 ])){
98
+ // if it's a string we don't replace it
99
+ if ($ trimmedContent [0 ] != "' " && $ trimmedContent [0 ] != '" ' ){
100
+ $ outputVariable = str_replace ('. ' , '-> ' , $ trimmedContent );
101
+ $ string = str_replace ($ bladeCurlyBraceMatches [0 ][$ index ], '{{ $ ' . $ outputVariable . '}} ' , $ string );
102
+ }
103
+ }
104
+ }
105
+
91
106
return $ string ;
92
107
}
93
108
Original file line number Diff line number Diff line change @@ -58,8 +58,7 @@ public function boot()
58
58
$ response = Tails::getResponse ($ projectURL );
59
59
$ data = Tails::getDataFromResponse ($ key , $ response );
60
60
61
- $ data = str_replace ('" ' , '\" ' , $ data );
62
- return '<?php echo \Blade::render(" ' . $ data . '"); ?> ' ;
61
+ return \Blade::render ($ data );
63
62
});
64
63
65
64
}
You can’t perform that action at this time.
0 commit comments