36 lines
694 B
PHP
36 lines
694 B
PHP
|
<?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()
|
||
|
{
|
||
|
//
|
||
|
}
|
||
|
}
|