* * @param \Illuminate\View\Engines\EngineResolver $resolver * @return void */ public function registerBladeEngine($resolver) { $this->app->singleton('blade.compiler', function () { return new BladeFiltersCompiler( $this->app['files'], $this->app['config']['view.compiled'] ); }); $resolver->register('blade', function () { return new CompilerEngine($this->app['blade.compiler']); }); } }Don’t forget to register it in your app.php config file!
*)(?=\);\s\?>)/u', function ($matches) { return $this->parseFilters($matches[0]); }, $value); } /** * Parse the blade filters and pass them to the echo.
*)/u', $value, $matches)) { return $value; } $filters = preg_split('/\|(?=(?
:[^\'\"\`]*([\'\"\`])[^\'\"\`]*\1)*[^\'\"\`]*$)/u', $matches[0]); if (empty($filters = array_values(array_filter(array_map('trim', $filters))))) { return $value; } foreach ($filters as $key => $filter) { $filter = preg_split('/:(?=(?
The Blade Filters PackageWe wrote a package, that handles the filter parsing and compiling behind the scenes.