-1

File Directory: C:\laragon\www\first-laravel-app\vendor\laravel\framework\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

Arguments "View [products.index] not found."

When attempting to access the page at http://127.0.0.1:8000/products, it says products.index not found.

bhooks
  • 409
  • 5
  • 16

1 Answers1

0

Because you are initializing a route as a resource you need to define methods for each of the possible routes in your ProductController class.

See: Laravel - Route::resource vs Route::controller

bhooks
  • 409
  • 5
  • 16