tex/src/TexServiceProvider.php

35 lines
661 B
PHP

<?php
namespace Zoomyboy\Tex;
use Illuminate\Support\ServiceProvider;
use Illuminate\View\Engines\CompilerEngine;
class TexServiceProvider extends ServiceProvider
{
/**
* Register services.
*
* @return void
*/
public function register()
{
view()->addExtension('tex', 'tex', function () {
$compiler = new TexCompiler(app('files'), config('view.compiled'));
return new CompilerEngine($compiler, app('files'));
});
app()->bind('tex.compiler', Compiler::class);
}
/**
* Bootstrap services.
*
* @return void
*/
public function boot()
{
}
}