0
I am learning to autoload using Composer, but am getting the following error while running the tests:
Fatal error: Class 'App Model Database' not found in /var/www/Library/index.php on line 5
it’s like he’s not finding the Database class, and I don’t know why, someone could help me?
Code:
Composer.json:
{
"autoload": {
"psr-4": {
"App\\" : "App/"
}
}
}
Database.php
<?php
namespace App\Model;
class Database
{
...
index php.
<?php
use App\Model\DataBase;
$pdo = Database::conexao();
Related: https://answall.com/questions/213080/autoload-do-composer-n%C3%A3o-funciona
– novic