| Conditions | 2 |
| Paths | 1 |
| Total Lines | 17 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 13 | public function boot() |
||
| 14 | { |
||
| 15 | $this->publishes([ |
||
| 16 | __DIR__.'/../resources/config/partialcache.php' => config_path('partialcache.php'), |
||
| 17 | ], 'config'); |
||
| 18 | |||
| 19 | $directive = config('partialcache.directive'); |
||
| 20 | |||
| 21 | Blade::directive($directive, function ($expression) { |
||
| 22 | if (starts_with($expression, '(')) { |
||
| 23 | $expression = substr($expression, 1, -1); |
||
| 24 | } |
||
| 25 | |||
| 26 | return "<?php echo app()->make('partialcache') |
||
| 27 | ->cache(array_except(get_defined_vars(), ['__data', '__path']), {$expression}); ?>"; |
||
| 28 | }); |
||
| 29 | } |
||
| 30 | |||
| 42 |