/** {@inheritDoc} */ public function register() { /** @var \Illuminate\Foundation\Application $app */ $app = parent::register(); $config = array_dot($this->app['config']['blade_extensions']); if ($config['example_views'] === true) { $this->viewDirs = ['views' => 'blade-ext']; } AssignmentDirectives::attach($app); DebugDirectives::attach($app); ForeachDirectives::attach($app); EmbeddingDirectives::attach($app); MacroDirectives::attach($app); MinifyDirectives::attach($app); # Optional markdown compiler, engines and directives if ($config['markdown.enabled']) { if (!class_exists($config['markdown.renderer'])) { throw new Exception('The configured markdown renderer class does not exist'); } $app->bind('Radic\\BladeExtensions\\Contracts\\MarkdownRenderer', $config['markdown.renderer']); $app->singleton('markdown', function (Application $app) { return $app->make('Radic\\BladeExtensions\\Contracts\\MarkdownRenderer'); }); $app->singleton('markdown.compiler', function (Application $app) { $markdownRenderer = $app->make('markdown'); $files = $app->make('files'); $storagePath = $app['config']->get('view.compiled'); return new MarkdownCompiler($markdownRenderer, $files, $storagePath); }); MarkdownDirectives::attach($app); } }
/** * Register the service provider. * * @return void */ public function register() { $app = parent::register(); $config = $app->make('config'); $app->singleton('fs', Filesystem::class); $this->registerStubs(); $this->registerHelpers(); }
/** * Register bindings in the container. * * @return Application */ public function register() { $app = parent::register(); $this->registerFilters(); }