yyx990803 / laravel-vue-cli-3

Example project using Vue CLI 3 with Laravel
848 stars 183 forks source link

Trying to implement in my code, but something don't work... #24

Closed jordiSabartresCastillo closed 5 years ago

jordiSabartresCastillo commented 5 years ago

Im trying to link my vue.cli project to laravel and I follow the steps but I have this error, and I don't know how i can solve.

InvalidArgumentException View [index] not found.

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;
            }
        }
    }

   ------ red line ----- 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);
}
louisdesmet commented 5 years ago

because laravel has the basic view welcome and not index, just change the name to index