Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A custom designed PHP API which supports dynamic controller and action pointing with authentication

License

rkshaw/php-dynamic-route-api

Repository files navigation

PHP API PSR-4 Demo

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:

  1. Unzip into your htdocs (e.g., D:/xampp/htdocs/php-api-psr4)
  2. Run: composer install
  3. Create database and table (see app/Config/sql.sql)
  4. Adjust DB credentials in app/Config/config.php
  5. Start Apache or run: php -S localhost:8000 -t public
  6. Access API via: http://localhost/php-api-psr4/public/api/products

About

A custom designed PHP API which supports dynamic controller and action pointing with authentication

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

AltStyle によって変換されたページ (->オリジナル) /