I'm learning to do autoload using the composer, but I'm getting the following error while performing 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 do not know why anyone 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();