Meme Commander
Meme Commander

Reputation: 1

/vendor/autoload.php error while running laravel

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

Upvotes: 0

Views: 8075

Answers (1)

Jigesh Raval
Jigesh Raval

Reputation: 303

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

Upvotes: 1

Related Questions