이 오류의 원인은 Illuminate \ View \ Compilers \ Compiler.php에서 추적 할 수 있습니다.
public function __construct(Filesystem $files, $cachePath)
{
if (! $cachePath) {
throw new InvalidArgumentException('Please provide a valid cache path.');
}
$this->files = $files;
$this->cachePath = $cachePath;
}
생성자는 Illuminate \ View \ ViewServiceProvider의 BladeCompiler에 의해 호출됩니다.
/**
* Register the Blade engine implementation.
*
* @param \Illuminate\View\Engines\EngineResolver $resolver
* @return void
*/
public function registerBladeEngine($resolver)
{
// The Compiler engine requires an instance of the CompilerInterface, which in
// this case will be the Blade compiler, so we'll first create the compiler
// instance to pass into the engine so it can compile the views properly.
$this->app->singleton('blade.compiler', function () {
return new BladeCompiler(
$this->app['files'], $this->app['config']['view.compiled']
);
});
$resolver->register('blade', function () {
return new CompilerEngine($this->app['blade.compiler']);
});
}
따라서 다음 코드를 추가로 추적하십시오.
$this->app['config']['view.compiled']
표준 라 라벨 구조를 사용하는 경우 일반적으로 /config/view.php에 있습니다.
<?php
return [
/*
|--------------------------------------------------------------------------
| View Storage Paths
|--------------------------------------------------------------------------
|
| Most templating systems load templates from disk. Here you may specify
| an array of paths that should be checked for your views. Of course
| the usual Laravel view path has already been registered for you.
|
*/
'paths' => [
resource_path('views'),
],
/*
|--------------------------------------------------------------------------
| Compiled View Path
|--------------------------------------------------------------------------
|
| This option determines where all the compiled Blade templates will be
| stored for your application. Typically, this is within the storage
| directory. However, as usual, you are free to change this value.
|
*/
'compiled' => realpath(storage_path('framework/views')),
];
경로가 없으면 realpath (...) 는 false를 반환합니다. 따라서 호출
'Please provide a valid cache path.' error.
따라서이 오류를 없애기 위해 할 수있는 일은
storage_path('framework/views')
또는
/storage/framework/views
존재 :)