Home > Enterprise >  /vendor/autoload.php error while running laravel
/vendor/autoload.php error while running laravel

Time:01-13

so im new to laravel, just downloaded composer, created new project through terminal in vscode, tried to run it and this error shows up

Error in localhost>public

The Code:

require_once __DIR__ . '/vendor/autoload.php'; 

and also getting errors while compiling on these:

$response = $kernel->handle(
$request = Request::capture()   //Undefined type 'Illuminate\Http\Request'//
)->send();

the illuminate code:

use Illuminate\Http\Request;

Help would be appreciated

CodePudding user response:

You should have following code for autoload.php. Basically, you're trying to look for vendor directory in the public folder, whereas it is normally placed in the base directory

require __DIR__.'/../vendor/autoload.php';

CodePudding user response:

Did you try running a composer update command?

  •  Tags:  
  • Related