इस त्रुटि का कारण 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 (...) गलत है, अगर पथ मौजूद नहीं है। इस प्रकार, आह्वान
'Please provide a valid cache path.' error.
इसलिए, इस त्रुटि से छुटकारा पाने के लिए, आप यह सुनिश्चित करने के लिए क्या कर सकते हैं
storage_path('framework/views')
या
/storage/framework/views
मौजूद :)