Skip to content

PHP + Laravel design (historical)

This is the original design document that motivated splitting the PHP side into auth-server-php (vanilla core) + auth-server-laravel (framework adapter). It lives in the auth platform repo as AUTH-PHP-LARAVEL-DESIGN.md.

Useful when adding a future PHP-framework adapter (Symfony, CodeIgniter, etc.) — the split is intentionally similar to the TS side so the pattern is reusable.

Full text: AUTH-PHP-LARAVEL-DESIGN.md in the auth-server repo.

Short version:

  • auth-server-php is the framework-agnostic core. Mirrors auth-server-ts directory-for-directory so the patterns translate. PSR-driven ports (PSR-18, PSR-16, PSR-3) mean any modern PHP framework can plug in its own implementations.
  • auth-server-laravel is the Laravel adapter. The custom guard + user provider + middleware aliases + Blade directives are all thin glue.
  • A Symfony adapter would look almost identical (security bundle, voter, twig extension, custom user provider, services.yaml binding).

Two integration patterns

  • Pattern A — stateless. No local users table. auth()->user() returns the principal directly.
  • Pattern B — composable. Local users table referenced by vendidit_id. The guard hydrates the model on each request.

config/vauth.php picks the pattern.