0
I’m having trouble in hr adding a class to my autoload, keeps giving Class Routes not found! Could someone help me?
Composer.json
"autoload": {
"psr-4": {
"App\\Http\\Controllers\\": "app/Http/Controllers/"
}
},
Routes.php
<?php
namespace App\Http\Controllers;
class Routes {
public function route() {
return 'Ola';
}
}
index php.
<?php
require 'vendor/autoload.php';
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;
use App\Http\Controllers;
$mail = new PHPMailer(true);
$route = new Routes();
dd($route->route());
Still n worked, ta dando Uncaught Error: Class 'App Http Controllers Routes' not found. http://prntscr.com/n7nk4h
– João pedro