for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Lanin\Laravel\EmailTemplatesOptimization;
use Illuminate\View\Engines\CompilerEngine;
class ServiceProvider extends \Illuminate\Support\ServiceProvider
{
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
$configPath = __DIR__ . '/../config/view.php';
$this->mergeConfigFrom($configPath, 'view');
}
* Register the service provider.
public function register()
$this->registerEmailEngine();
* Register the Blade engine implementation.
public function registerEmailEngine()
$app = $this->app;
$app->bind('email.compiler', function () use ($app) {
$cache = $app['config']['view.compiled'];
$css = $app['config']['view.emails.css_files'];
return new Compiler($app['files'], $cache, $css);
});
$app['view']->addExtension('email.php', 'email', function () use ($app) {
return new CompilerEngine($app['email.compiler']);
* Get the services provided by the provider.
* @return array
public function provides()
return [
'email.compiler'
];