Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.skyvexsoftware.com/llms.txt

Use this file to discover all available pages before exploring further.

The Stratos Logbook API is a phpVMS 7 module that exposes the pilot’s flight history to the Stratos desktop client. It adds three endpoints — paginated list, single-PIREP detail with route and log timelines, and aggregate stats — and reads exclusively from phpVMS-native tables.

What it adds

The module mounts these endpoints under /api/stratos/logbook on your phpVMS install. All require a Bearer token — the same users.api_key Core uses, via Core’s StratosAuth middleware.
GET    /api/stratos/logbook/pireps           paginated PIREP list
GET    /api/stratos/logbook/pireps/{id}      single PIREP detail with route + log
GET    /api/stratos/logbook/stats            aggregate stats

GET /pireps — list

Paginated, sortable, searchable list of the authenticated pilot’s PIREPs. Excludes in-progress flights, drafts, cancellations, and deleted records — only PENDING, ACCEPTED, and REJECTED states are returned. Query parameters:
ParamTypeNotes
limitint 1–100Page size. Default 25.
offsetintPage offset. Default 0.
sortenumOne of date, route, aircraft, duration, distance, landing_rate, status. Default date.
orderenumasc or desc. Default desc.
qstringFree-text search across flight number, departure ICAO, and arrival ICAO.
statusenumFilter to a single state: pending, accepted, or rejected.

GET /pireps/{id} — detail

A single PIREP scoped to the authenticated pilot (404s if the ID belongs to another pilot, or if the PIREP is still in progress). Includes the full polyline (route) sourced from the acars table’s FLIGHT_PATH rows, and the log timeline (log) from the LOG rows.

GET /stats — aggregate stats

Lifetime totals (sourced from the denormalised columns on users.flights and users.flight_time) plus computed slices (flights this month, hours this year, sum of accepted-flight distance, average landing rate, current rank).

Install

1

Install Core first

If you haven’t already, install Stratos Core API and verify the handshake endpoint responds. Logbook will refuse to load without it.
2

Download the Logbook module

Grab the latest module.zip from the Logbook releases page.
3

Upload via the admin UI

In your phpVMS admin, navigate to Admin → Modules → Add New Module and upload the module.zip. phpVMS extracts it to modules/StratosLogbook/.
4

Enable the module

On the Modules list, find StratosLogbook and click Enable.
5

Clear caches

php artisan optimize:clear
6

Verify

With a valid pilot api_key in hand:
curl -H "Authorization: Bearer <pilot_api_key>" \
  https://crew.youva.com/api/stratos/logbook/stats
You should get a JSON response with total_flights, hours_flown, etc.

What pilots see

Once Logbook is installed, the Stratos desktop client surfaces it automatically — there’s no per-pilot configuration. Pilots get:
  • A Logbook entry in the sidebar
  • A scrollable, sortable list of every PIREP they’ve filed
  • A detail view per PIREP with the route plotted on a map and the in-flight event log replayed
  • A stats panel showing their lifetime totals and recent activity
The data comes straight from phpVMS — the same numbers you see in the pilot’s profile in the phpVMS admin will appear in Stratos.

What’s excluded from the list

By design, the list endpoint only returns historical states:
  • PENDING — filed but not yet reviewed by an admin
  • ACCEPTED — approved
  • REJECTED — rejected by an admin
The following are excluded and will not appear in the logbook even if rows exist in the pireps table:
  • IN_PROGRESS — pilot is currently flying
  • PAUSED — pilot has paused their flight
  • DRAFT — never submitted
  • CANCELLED — pilot cancelled mid-flight
  • DELETED — soft-deleted
If a pilot reports a missing flight in their logbook, check its state in the pireps table first.

Troubleshooting

Class not found errors mentioning Modules\StratosCore\...

The Logbook module imports Core’s StratosAuth middleware. If Core isn’t installed and enabled, Logbook can’t boot. Confirm via:
php artisan module:list | grep -E "StratosCore|StratosLogbook"
Both should show as Enabled. If StratosCore isn’t listed, install it before Logbook (see Stratos Core API).

/api/stratos/logbook/* returns 404 but the module shows as enabled

Same fix as Core’s equivalent issue — flush the route + module caches:
php artisan route:clear
php artisan optimize:clear

A pilot says their logbook is empty but they’ve filed PIREPs

The most likely cause is that all their existing PIREPs are still in IN_PROGRESS state (e.g. flights logged via an older ACARS tracker that never marked them as filed). Check:
SELECT state, COUNT(*) FROM pireps WHERE user_id = <pilot_id> GROUP BY state;
States 0 (IN_PROGRESS), 3 (CANCELLED), 4 (DELETED), 5 (DRAFT), 7 (PAUSED) won’t appear. To bring them into the logbook, an admin can manually mark them as ACCEPTED in the phpVMS admin (Pilot → PIREPs → Edit).

Updating

Same flow as Core: download the new module.zip from the releases page, upload via Admin → Modules → Add New Module, then run php artisan optimize:clear. The current release ships zero migrations.

Contributing

PRs against SkyvexSoftware/stratos-logbook-api welcome. Bug reports in Issues — please include the phpVMS version, the Stratos client version, and a relevant snippet from storage/logs/laravel.log.