Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move blademd registration to boot method of service provider #254

Merged
merged 2 commits into from
Jun 25, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 5 additions & 9 deletions src/ScribeServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,18 @@

class ScribeServiceProvider extends ServiceProvider
{
public function register()
{
// Register custom Markdown Blade compiler so we can automatically have MD views converted to HTML
$app = $this->app;
$app->view->getEngineResolver()
->register('blademd', fn() => new BladeMarkdownEngine($app['blade.compiler']));
$app->view->addExtension('md.blade.php', 'blademd');
}

/**
* Bootstrap the application events.
*
* @return void
*/
public function boot()
{
// Register custom Markdown Blade compiler so we can automatically have MD views converted to HTML
$this->app->view->getEngineResolver()
->register('blademd', fn() => new BladeMarkdownEngine($this->app['blade.compiler']));
$this->app->view->addExtension('md.blade.php', 'blademd');

$this->loadViewsFrom(__DIR__ . '/../resources/views/', 'scribe');

// Publish views in separate, smaller groups for ease of end-user modifications
Expand Down