diff --git a/src/Illuminate/Foundation/Console/ViewCacheCommand.php b/src/Illuminate/Foundation/Console/ViewCacheCommand.php index f3f1282f622e..03f8d75d9a39 100644 --- a/src/Illuminate/Foundation/Console/ViewCacheCommand.php +++ b/src/Illuminate/Foundation/Console/ViewCacheCommand.php @@ -5,6 +5,7 @@ use Illuminate\Console\Command; use Illuminate\Support\Collection; use Symfony\Component\Console\Attribute\AsCommand; +use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Finder\Finder; use Symfony\Component\Finder\SplFileInfo; @@ -46,9 +47,15 @@ public function handle() $this->callSilent('view:clear'); $this->paths()->each(function ($path) { + $prefix = $this->output->isVeryVerbose() ? 'DIR ' : ''; + + $this->components->task($prefix.$path, null, OutputInterface::VERBOSITY_VERBOSE); + $this->compileViews($this->bladeFilesIn([$path])); }); + $this->newLine(); + $this->components->info('Blade templates cached successfully.'); } @@ -63,8 +70,14 @@ protected function compileViews(Collection $views) $compiler = $this->laravel['view']->getEngineResolver()->resolve('blade')->getCompiler(); $views->map(function (SplFileInfo $file) use ($compiler) { + $this->components->task(' '.$file->getRelativePathname(), null, OutputInterface::VERBOSITY_VERY_VERBOSE); + $compiler->compile($file->getRealPath()); }); + + if ($this->output->isVeryVerbose()) { + $this->newLine(); + } } /**