/**
  * Setup the blade compiler class.
  *
  * @param \Illuminate\Contracts\View\Factory $view
  *
  * @return void
  */
 protected function setupBlade(View $view)
 {
     $blade = $view->getEngineResolver()->resolve('blade')->getCompiler();
     $blade->directive('auth', function ($expression) {
         return "<?php if (\\GrahamCampbell\\Credentials\\Facades\\Credentials::check() && \\GrahamCampbell\\Credentials\\Facades\\Credentials::hasAccess{$expression}): ?>";
     });
     $blade->directive('endauth', function () {
         return '<?php endif; ?>';
     });
 }
 /**
  * Setup the blade compiler class.
  *
  * @param \Illuminate\Contracts\View\Factory $view
  *
  * @return void
  */
 protected function setupBlade(View $view)
 {
     $blade = $view->getEngineResolver()->resolve('blade')->getCompiler();
     $blade->extend(function ($value, $compiler) {
         $pattern = $compiler->createMatcher('auth');
         $replace = '$1<?php if (\\App\\Facades\\Credentials::check() && \\App\\Facades\\Credentials::hasAccess$2): ?>';
         return preg_replace($pattern, $replace, $value);
     });
     $blade->extend(function ($value, $compiler) {
         $pattern = $compiler->createPlainMatcher('endauth');
         $replace = '$1<?php endif; ?>$2';
         return preg_replace($pattern, $replace, $value);
     });
 }
 /**
  * boot.
  *
  * @method boot
  *
  * @param \Illuminate\Contracts\Http\Kernel $kernel
  * @param \Illuminate\Contracts\View\Factory $view
  */
 public function boot(Kernel $kernel, View $view)
 {
     if ($this->app->runningInConsole() === true) {
         $this->publishes([__DIR__ . '/../config/tracy.php' => $this->app->configPath() . '/tracy.php'], 'config');
         return;
     }
     if ($this->app['config']['tracy']['enabled'] === true) {
         $this->app->extend(ExceptionHandler::class, function ($exceptionHandler, $app) {
             return $app->make(Handler::class, ['exceptionHandler' => $exceptionHandler]);
         });
         $kernel->prependMiddleware(Dispatch::class);
     }
     $view->getEngineResolver()->resolve('blade')->getCompiler()->directive('bdump', function ($expression) {
         return "<?php \\Tracy\\Debugger::barDump({$expression}); ?>";
     });
 }