src/Console/OptimizeCommand.php
protected function compileViewsInPath(string $path): void
    {
        foreach ($this->laravel['files']->allFiles($path) as $file) {
            try {
                $engine = $this->laravel['view']->getEngineFromPath($file);
            } catch (InvalidArgumentException $e) {
                continue;
            }

            $this->compileSingleViewFile($engine, $file);
        }
    }
protected function compileViewsInPath(string $path): void
    {
        foreach ($this->laravel['files']->allFiles($path) as $file) {
            try {
                $engine = $this->laravel['view']->getEngineFromPath($file);
            } catch (InvalidArgumentException $e) {
                continue;
            }

            $this->compileSingleViewFile($engine, $file);
        }
    }
Compile all views files in path.

@param  string  $path

@return void