Skip to content

TyteRide API

Laravel 11 REST API for TyteRide, built with DDD slices and TDD.

  • Base path: /api (health: /api/health and /up).
  • Auth: phone + OTP → Sanctum token; no email/password.
  • Tenancy: company-scoped APIs via ResolveCompanyContext + global CompanyScope; cross-tenant access returns 404.
  • Realtime: Reverb channels private-company.{companyId} and trip.{tripId}.
  • Error envelope: { "message": string, "errors"?: Record<string, string[]> }.

Local setup

COMPOSER_ALLOW_SUPERUSER=1 composer install
cp .env.example .env
php artisan key:generate
touch database/database.sqlite
php artisan migrate
php artisan serve

Test and quality

php artisan test
vendor/bin/pint --test
vendor/bin/phpstan analyse --no-progress

Docs