Source: pineco.de

Laravel Blade Filters

Category: Laravel

* * @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.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge. Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge.
Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Shirts painstakingly handcrafted by under-caffeinated developers. Shirts painstakingly handcrafted by under-caffeinated developers.
Community Partners