Create ilhan inside the root of the project directory and not in the vendor directory and put the following in composer.json .
"autoload": { "psr-4": { "Ilhan\\": "ilhan/" } },
Most likely, you already have psr-4 config autoload added to your composer.json file, if you use some kind of framework, in this case just add "Ilhan\\": "ilhan/" to it. Create People.php inside ilhan directory with the following contents
<?php namespace Ilhan; class People{}
Make sure require __DIR__.'/vendor/autoload.php'; included in index.php any way, then run composer dump-autoload .
Now in index.php only lower than require __DIR__.'/vendor/autoload.php'; should work
use Ilhan\People;
But why do you want to use the People class in index.php ?
source share