Features:
- PSR-4 autoloading
- Dynamic router (auto-load controllers by path)
- JWT Auth (login issues token)
- Auth middleware + Exception middleware
- PDO Database service (configure DB in app/Config/config.php)
- Product CRUD (id,name,size,is_available)
- Custom action routing: /api/{controller}/{customMethod}
- Swagger annotations (swagger.php + app/Docs/*.php)
Setup:
- Unzip into your htdocs (e.g., D:/xampp/htdocs/php-api-psr4)
- Run: composer install
- Create database and table (see app/Config/sql.sql)
- Adjust DB credentials in app/Config/config.php
- Start Apache or run: php -S localhost:8000 -t public
- Access API via: http://localhost/php-api-psr4/public/api/products