8000 [11.x] Respect custom path for cached views by the `AboutCommand` (#5… · laravel/framework@e65c9b7 · GitHub
[go: up one dir, main page]

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit e65c9b7

Browse files
authored
[11.x] Respect custom path for cached views by the AboutCommand (#55179)
* Respect custom view path by AboutCommand * Add a test for the custom VIEW_COMPILED_PATH
1 parent b5ce211 commit e65c9b7

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

src/Illuminate/Foundation/Console/AboutCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ protected function gatherApplicationInformation()
183183
'Config' => static::format($this->laravel->configurationIsCached(), console: $formatCachedStatus),
184184
'Events' => static::format($this->laravel->eventsAreCached(), console: $formatCachedStatus),
185185
'Routes' => static::format($this->laravel->routesAreCached(), console: $formatCachedStatus),
186-
'Views' => static::format($this->hasPhpFiles($this->laravel->storagePath('framework/views')), console: $formatCachedStatus),
186+
'Views' => static::format($this->hasPhpFiles(config('view.compiled')), console: $formatCachedStatus),
187187
]);
188188

189189
static::addToSection('Drivers', fn () => array_filter([

tests/Integration/Foundation/Console/AboutCommandTest.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Illuminate\Tests\Integration\Foundation\Console;
44

55
use Illuminate\Testing\Assert;
6+
use Orchestra\Testbench\Attributes\WithEnv;
67
use Orchestra\Testbench\TestCase;
78

89
use function Orchestra\Testbench\remote;
@@ -40,4 +41,16 @@ public function testItCanDisplayAboutCommandAsJson()
4041
], $output['drivers']);
4142
});
4243
}
44+
45+
#[WithEnv('VIEW_COMPILED_PATH', __DIR__.'/../../View/templates')]
46+
public function testItRespectsCustomPathForCompiledViews(): void
47+
{
48+
$process = remote('about --json', ['APP_ENV' => 'local'])->mustRun();
49+
50+
tap(json_decode($process->getOutput(), true), static function (array $output) {
51+
Assert::assertArraySubset([
52+
'views' => true,
53+
], $output['cache']);
54+
});
55+
}
4356
}

0 commit comments

Comments
 (0)
0