File tree 2 files changed +6
-38
lines changed 2 files changed +6
-38
lines changed Original file line number Diff line number Diff line change 11
11
],
12
12
"homepage" : " https://github.com/Arrilot/laravel-widgets" ,
13
13
"require" : {
14
- "php" : " >=5.4.0 " ,
15
- "illuminate/support" : " 5.* " ,
16
- "illuminate/contracts" : " 5.* " ,
17
- "illuminate/view" : " 5.* " ,
18
- "illuminate/container" : " 5.* " ,
19
- "illuminate/console" : " 5.* "
14
+ "php" : " >=5.5.9 " ,
15
+ "illuminate/support" : " >=5.1 " ,
16
+ "illuminate/contracts" : " >=5.1 " ,
17
+ "illuminate/view" : " >=5.1 " ,
18
+ "illuminate/container" : " >=5.1 " ,
19
+ "illuminate/console" : " >=5.1 "
20
20
},
21
21
"require-dev" : {
22
22
"phpunit/phpunit" : " ~4.0"
Original file line number Diff line number Diff line change @@ -74,9 +74,6 @@ public function boot()
74
74
return "<?php echo app('arrilot.widget')->run {$ expression }; ?> " ;
75
75
});
76
76
77
- // Blade::directive cannot recognize @async-widget, so @async-widget still use the custom matcher.
78
- $ this ->registerBladeDirective ('async-widget ' , '$1<?php echo app("arrilot.async-widget")->run$2; ?> ' );
79
-
80
77
Blade::directive ('asyncWidget ' , function ($ expression ) {
81
78
return "<?php echo app('arrilot.async-widget')->run {$ expression }; ?> " ;
82
79
});
@@ -95,33 +92,4 @@ public function provides()
95
92
{
96
93
return ['arrilot.widget ' , 'arrilot.async-widget ' ];
97
94
}
98
-
99
- /**
100
- * Register a blade directive.
101
- *
102
- * @param $name
103
- * @param $expression
104
- */
105
- protected function registerBladeDirective ($ name , $ expression )
106
- {
107
- Blade::extend (function ($ view ) use ($ name , $ expression ) {
108
- $ pattern = $ this ->createMatcher ($ name );
109
-
110
- return preg_replace ($ pattern , $ expression , $ view );
111
- });
112
- }
113
-
114
- /**
115
- * Substitution for $compiler->createMatcher().
116
- *
117
- * Get the regular expression for a generic Blade function.
118
- *
119
- * @param string $function
120
- *
121
- * @return string
122
- */
123
- protected function createMatcher ($ function )
124
- {
125
- return '/(?<!\w)(\s*)@ ' .$ function .'(\s*\(.*\))/ ' ;
126
- }
127
95
}
You can’t perform that action at this time.
0 commit comments