adrema/app/Tex/TexServiceProvider.php

36 lines
694 B
PHP
Raw Normal View History

2021-07-17 15:25:39 +02:00
<?php
namespace App\Tex;
use Illuminate\Support\ServiceProvider;
use Illuminate\View\Compilers\BladeCompiler;
use Illuminate\View\DynamicComponent;
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'));
});
}
/**
* Bootstrap services.
*
* @return void
*/
public function boot()
{
//
}
}