文件目录:C:\larragon\www irst-laravel-app endor\laravel ramework\src\Illuminate\View\FileViewFinder.php
/**
* Find the given view in the list of paths.
*
* @param string $name
* @param array $paths
* @return string
*
* @throws \InvalidArgumentException
*/
protected function findInPaths($name, $paths)
{
foreach ((array) $paths as $path) {
foreach ($this->getPossibleViewFiles($name) as $file) {
if ($this->files->exists($viewPath = $path.'/'.$file)) {
return $viewPath;
}
}
}
throw new InvalidArgumentException("View [{$name}] not found.");
}
/**
* Get an array of possible view files.
*
* @param string $name
* @return array
*/
protected function getPossibleViewFiles($name)
{
return array_map(function ($extension) use ($name) {
return str_replace('.', '/', $name).'.'.$extension;
}, $this->extensions);
}
/**
* Add a location to the finder.
*
* @param string $location
* @return void
论点 “找不到[产品.索引]。”
尝试访问http://127.0.0.1:8000/products页面时,提示未找到products.index。
因为您正在将路由初始化为资源,所以您需要为 ProductController 类中的每个可能的路由定义方法。