src/Boot/ConfigureViewEngines.php
public function boot(Container $app)
    {
        $app->afterResolving(function (Factory $factory, $app) {

            $factory->addExtension('php', 'php', function () {
                return new PhpEngine();
            });

            $factory->addExtension('blade.php', 'blade', function () use ($app) {
                return new CompilerEngine($app->make(BladeCompiler::class));
            });

            $factory->addExtension('md', 'markdown', function () use ($app) {
                return new CompilerEngine($app->make(Markdown::class));
            });

        });

        $app->when(BladeCompiler::class)
            ->needs('$cachePath')
            ->give(vfsStream::setup('root/.blade')->url());
    }
public function boot(Container $app)
    {
        $app->afterResolving(function (Factory $factory, $app) {

            $factory->addExtension('php', 'php', function () {
                return new PhpEngine();
            });

            $factory->addExtension('blade.php', 'blade', function () use ($app) {
                return new CompilerEngine($app->make(BladeCompiler::class));
            });

            $factory->addExtension('md', 'markdown', function () use ($app) {
                return new CompilerEngine($app->make(Markdown::class));
            });

        });

        $app->when(BladeCompiler::class)
            ->needs('$cachePath')
            ->give(vfsStream::setup('root/.blade')->url());
    }
public function boot ( Container $ app ) { $ app -> afterResolving ( function ( Factory $ factory , $ app ) { $ factory -> addExtension ( 'php' , 'php' , function ( ) { return new PhpEngine ( ) ; } ) ; $ factory -> addExtension ( 'blade.php' , 'blade' , function ( ) use ( $ app ) { return new CompilerEngine ( $ app -> make ( BladeCompiler :: class ) ) ; } ) ; $ factory -> addExtension ( 'md' , 'markdown' , function ( ) use ( $ app ) { return new CompilerEngine ( $ app -> make ( Markdown :: class ) ) ; } ) ; } ) ; $ app -> when ( BladeCompiler :: class ) -> needs ( '$cachePath' ) -> give ( vfsStream :: setup ( 'root/.blade' ) -> url ( ) ) ; }
Set up the various view engines.

@param Container $app
Set up the various view engines .