File tree Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -70,16 +70,24 @@ public function boot()
7070 });
7171 }
7272
73- Blade::directive ('widget ' , function ($ expression ) {
74- return "<?php echo app('arrilot.widget')->run( {$ expression }); ?> " ;
73+ $ omitParenthesis = version_compare ($ this ->app ->version (), '5.3 ' , '< ' );
74+
75+ Blade::directive ('widget ' , function ($ expression ) use ($ omitParenthesis ) {
76+ $ expression = $ omitParenthesis ? $ expression : "( $ expression) " ;
77+
78+ return "<?php echo app('arrilot.widget')->run {$ expression }; ?> " ;
7579 });
7680
77- Blade::directive ('asyncWidget ' , function ($ expression ) {
78- return "<?php echo app('arrilot.async-widget')->run( {$ expression }); ?> " ;
81+ Blade::directive ('asyncWidget ' , function ($ expression ) use ($ omitParenthesis ) {
82+ $ expression = $ omitParenthesis ? $ expression : "( $ expression) " ;
83+
84+ return "<?php echo app('arrilot.async-widget')->run {$ expression }; ?> " ;
7985 });
8086
81- Blade::directive ('widgetGroup ' , function ($ expression ) {
82- return "<?php echo app('arrilot.widget-group-collection')->group( {$ expression })->display(); ?> " ;
87+ Blade::directive ('widgetGroup ' , function ($ expression ) use ($ omitParenthesis ) {
88+ $ expression = $ omitParenthesis ? $ expression : "( $ expression) " ;
89+
90+ return "<?php echo app('arrilot.widget-group-collection')->group {$ expression }->display(); ?> " ;
8391 });
8492 }
8593
You can’t perform that action at this time.
0 commit comments