commit 6c9c742ed8025515990014eeae5046bc58145807 Author: isaacclad Date: Mon Jun 29 11:36:22 2026 +0000 Initial Ladill Care release. Healthcare management app: patients, appointments, consultations, lab, pharmacy inventory, billing, and reports at care.ladill.com. Co-authored-by: Cursor diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..a186cd2 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,18 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +indent_size = 4 +indent_style = space +insert_final_newline = true +trim_trailing_whitespace = true + +[*.md] +trim_trailing_whitespace = false + +[*.{yml,yaml}] +indent_size = 2 + +[compose.yaml] +indent_size = 4 diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..3c01279 --- /dev/null +++ b/.env.example @@ -0,0 +1,37 @@ +APP_NAME="Ladill Care" +APP_ENV=local +APP_KEY= +APP_DEBUG=true +APP_URL=https://care.ladill.com + +PLATFORM_URL=https://ladill.com +PLATFORM_DOMAIN=ladill.com + +LOG_CHANNEL=stack +LOG_LEVEL=debug + +DB_CONNECTION=sqlite +DB_DATABASE=database/database.sqlite +# Production: DB_CONNECTION=mysql, DB_HOST=127.0.0.1, DB_DATABASE=ladill_care, DB_USERNAME=ladill_care + +SESSION_DRIVER=database +SESSION_LIFETIME=1440 +CACHE_STORE=database +QUEUE_CONNECTION=database + +# --- Ladill SSO (Sign in with Ladill — auth.ladill.com OIDC client) --- +LADILL_SSO_CLIENT_ID= +LADILL_SSO_CLIENT_SECRET= + +# --- Platform APIs this app consumes (per-consumer service keys) --- +BILLING_API_URL=https://ladill.com/api/billing +BILLING_API_KEY_CARE= +IDENTITY_API_URL=https://ladill.com/api +IDENTITY_API_KEY_CARE= + +# Platform events webhook (user/org lifecycle from the monolith) +SERVICE_EVENTS_INBOUND_SECRET= + +# --- Inbound service API keys (sibling Ladill apps calling Care) --- +CARE_API_KEY_FRONTDESK= +CARE_API_KEY_CRM= diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..fcb21d3 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,11 @@ +* text=auto eol=lf + +*.blade.php diff=html +*.css diff=css +*.html diff=html +*.md diff=markdown +*.php diff=php + +/.github export-ignore +CHANGELOG.md export-ignore +.styleci.yml export-ignore diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml new file mode 100644 index 0000000..51883df --- /dev/null +++ b/.gitea/workflows/deploy.yml @@ -0,0 +1,110 @@ +name: Deploy Ladill Care + +on: + push: + branches: + - main + workflow_dispatch: + +permissions: + contents: read + +concurrency: + group: deploy-care + cancel-in-progress: true + +jobs: + deploy: + runs-on: deploy + env: + NODE_ROOT: /tmp/ladill-node-22-r1 + NODE_VERSION: "22.14.0" + RELEASE_ARCHIVE: /tmp/ladill-care-release-${{ gitea.run_id }}-${{ gitea.run_attempt }}.tgz + WORKSPACE: /tmp/${{ gitea.repository_owner }}-care-${{ gitea.run_id }}-${{ gitea.run_attempt }} + LADILL_APP_ROOT: /var/www/ladill-care + steps: + - name: Checkout + shell: bash {0} + run: | + set -Eeuo pipefail + DEPLOY_GITEA_TOKEN="$(cat /home/deploy/.ladill-deploy-gitea-token)" + REPO_URL="${{ gitea.server_url }}/${{ gitea.repository }}.git" + rm -rf "$WORKSPACE" + mkdir -p "$WORKSPACE" + export GIT_TERMINAL_PROMPT=0 + git \ + -c credential.helper= \ + -c http.extraHeader="Authorization: token ${DEPLOY_GITEA_TOKEN}" \ + clone --depth 1 --single-branch --no-tags --branch "${{ gitea.ref_name }}" \ + "$REPO_URL" "$WORKSPACE" + + - name: Setup Node.js + shell: bash {0} + run: | + set -Eeuo pipefail + if [ ! -x "$NODE_ROOT/bin/node" ]; then + rm -rf "$NODE_ROOT" + mkdir -p "$NODE_ROOT" + case "$(uname -m)" in + x86_64|amd64) NODE_ARCH="x64" ;; + aarch64|arm64) NODE_ARCH="arm64" ;; + *) echo "Unsupported architecture: $(uname -m)" >&2; exit 1 ;; + esac + curl -fsSL "https://nodejs.org/download/release/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-${NODE_ARCH}.tar.xz" \ + | tar -xJ --strip-components=1 -C "$NODE_ROOT" + fi + "$NODE_ROOT/bin/node" -v + + - name: Build frontend assets + shell: bash {0} + run: | + set -Eeuo pipefail + cd "$WORKSPACE" + export PATH="$NODE_ROOT/bin:$PATH" + npm ci --no-audit --no-fund + npm run build + + - name: Build release archive + shell: bash {0} + run: | + set -Eeuo pipefail + cd "$WORKSPACE" + printf '%s\n' "${{ gitea.sha }}" > REVISION + rm -f "$RELEASE_ARCHIVE" + tar -czf "$RELEASE_ARCHIVE" \ + --exclude=.git --exclude=.gitea --exclude=.github --exclude=.env \ + --exclude=node_modules --exclude=vendor --exclude=storage --exclude=tests . + + - name: Deploy release + shell: bash {0} + env: + LADILL_RELEASE_ARCHIVE: /tmp/ladill-care-release-${{ gitea.run_id }}-${{ gitea.run_attempt }}.tgz + run: | + set -Eeuo pipefail + : "${LADILL_APP_ROOT:?Set LADILL_APP_ROOT}" + bash "$WORKSPACE/deploy/deploy.sh" + + - name: Ensure nginx vhost + shell: bash {0} + run: | + set -Eeuo pipefail + NGINX_SCRIPT="$WORKSPACE/deployment/setup-service-subdomain-nginx.sh" + if [ ! -f "$NGINX_SCRIPT" ]; then + NGINX_SCRIPT="/var/www/ladill.com/current/deployment/setup-service-subdomain-nginx.sh" + fi + if [ ! -f "$NGINX_SCRIPT" ]; then + echo "WARN: setup-service-subdomain-nginx.sh not found — configure care.ladill.com vhost manually" + exit 0 + fi + if sudo -n bash "$NGINX_SCRIPT" care --app /var/www/ladill-care/current; then + echo "nginx vhost updated for care.ladill.com" + else + echo "WARN: nginx vhost step skipped (deploy user cannot sudo) — vhost must already be provisioned" + fi + + - name: Cleanup + if: always() + shell: bash {0} + run: | + rm -rf "$WORKSPACE" + rm -f "$RELEASE_ARCHIVE" diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..fd47ce8 --- /dev/null +++ b/.gitignore @@ -0,0 +1,31 @@ +*.log +.DS_Store +.env +.env.backup +.env.production +.phpactor.json +.phpunit.result.cache +/.fleet +/.idea +/.nova +/.phpunit.cache +/.vscode +/.zed +/auth.json +/node_modules +/public/build +/public/hot +/public/storage +/storage/*.key +/storage/pail +/storage/framework/views/* +!/storage/framework/views/.gitignore +/vendor +Homestead.json +Homestead.yaml +Thumbs.db + +# Native mobile apps — kept locally, not tracked in this repo +/apps + +/database/database.sqlite diff --git a/DEPLOY.md b/DEPLOY.md new file mode 100644 index 0000000..bccabea --- /dev/null +++ b/DEPLOY.md @@ -0,0 +1,85 @@ +# Ladill Care — deploy runbook + +Healthcare management at **care.ladill.com** (patients, appointments, consultations, lab, pharmacy, billing). + +## 1. Gitea repo + CI + +- Repo: **ladill-care** (`isaacclad/ladill-care`). +- Push to `main` triggers `.gitea/workflows/deploy.yml` (on-host `deploy` runner). +- App root: `/var/www/ladill-care`. + +To publish from the monorepo copy: + +```bash +bash scripts/extract-ladill-care.sh +``` + +## 2. Server app-slot + database + +```bash +sudo install -d -o deploy -g www-data /var/www/ladill-care +sudo install -d -o deploy -g www-data /var/www/ladill-care/{releases,shared} +sudo mysql -e "CREATE DATABASE ladill_care CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;" +sudo mysql -e "CREATE USER 'ladill_care'@'127.0.0.1' IDENTIFIED BY '';" +sudo mysql -e "GRANT ALL ON ladill_care.* TO 'ladill_care'@'127.0.0.1'; FLUSH PRIVILEGES;" +``` + +## 3. Platform wiring (monolith) + +On the Ladill platform host: + +```bash +cd /var/www/ladill.com/current +php artisan ladill:onboard-app care --run-dns +php artisan passport:client --name="Ladill Care" --redirect_uri=https://care.ladill.com/sso/callback +php artisan ladill:launcher:sync --propagate +``` + +Apply the generated `IDENTITY_API_KEY_CARE`, `BILLING_API_KEY_CARE`, +`SERVICE_EVENTS_CARE_*`, and `SERVICE_EVENTS_INBOUND_SECRET` values to the monolith `.env`, then: + +```bash +php artisan config:cache +``` + +## 4. Shared `.env` (`/var/www/ladill-care/shared/.env`) + +Copy `.env.example`, set production values: + +| Variable | Notes | +|----------|-------| +| `APP_KEY` | `php artisan key:generate --show` | +| `APP_URL` | `https://care.ladill.com` | +| `DB_*` | MySQL `ladill_care` credentials | +| `LADILL_SSO_CLIENT_ID` / `LADILL_SSO_CLIENT_SECRET` | Passport client (plain text from `passport:client`) | +| `BILLING_API_KEY_CARE` | Same as monolith consumer key | +| `IDENTITY_API_KEY_CARE` | Same as monolith consumer key | +| `SERVICE_EVENTS_INBOUND_SECRET` | Same as monolith `SERVICE_EVENTS_CARE_SECRET` | + +**SSO secret:** use the plain-text value printed once by `passport:client` — never copy +`oauth_clients.secret` from the database (Passport stores a bcrypt hash there). + +## 5. nginx + TLS + +```bash +sudo bash deployment/setup-service-subdomain-nginx.sh care --app /var/www/ladill-care/current +``` + +DNS: `care.ladill.com` → app server (via `dns:sync-subdomains` on the monolith). + +## 6. First deploy + +Push to `main` or run the Gitea deploy workflow manually. Then verify: + +```bash +curl -sI https://care.ladill.com | head -1 +curl -s -o /dev/null -w '%{http_code}\n' https://care.ladill.com/login +curl -s https://care.ladill.com/api/health +``` + +## 7. Optional queue worker + +```bash +sudo cp deployment/supervisor/ladill-care-worker.conf /etc/supervisor/conf.d/ +sudo supervisorctl reread && sudo supervisorctl update +``` diff --git a/README.md b/README.md new file mode 100644 index 0000000..99a2f82 --- /dev/null +++ b/README.md @@ -0,0 +1,55 @@ +# Ladill Care + +Healthcare management for clinics and hospitals at **care.ladill.com** — patients, +appointments, queue, consultations, vitals, lab, prescriptions, pharmacy inventory, +encounter billing, and operational reports. + +Authenticates via **Sign in with Ladill** (OIDC against `auth.ladill.com`). Every +clinical record is scoped to a platform account (`owner_ref`) and organization. + +## Features + +- **Patients** — registration, medical history, documents, visit timeline +- **Appointments & queue** — booking, walk-in, check-in, department queue +- **Consultations** — vitals, diagnoses, investigations, prescriptions +- **Laboratory** — test catalog, sample collection, results, approval +- **Pharmacy** — dispensing queue, drug inventory, batch stock tracking +- **Billing** — visit invoices, line items, payments, print view +- **Reports** — patients, appointments, lab, finance, clinical (CSV export) +- **Admin** — branches, departments, practitioners, members, audit log + +## Platform integration + +| Integration | Purpose | +|-------------|---------| +| OIDC SSO | User authentication (`LADILL_SSO_*`) | +| Billing API | Wallet top-up / purchases (`BILLING_API_KEY_CARE`) | +| Identity API | Platform user lookups (`IDENTITY_API_KEY_CARE`) | +| Service events | Inbound webhooks for `user.deleted`, `user.suspended`, `organization.updated` | + +Registry entry lives in the monolith `config/ladill_apps.php` (`care` slug). + +## Local development + +```bash +composer install +cp .env.example .env && php artisan key:generate +touch database/database.sqlite # sqlite is fine for local +php artisan migrate +npm install && npm run build # or `npm run dev` +php artisan serve +php artisan test +``` + +For SSO locally, point `LADILL_SSO_*` at a Passport client on your Ladill platform +dev instance, or bypass `EnsurePlatformSession` in tests (see `CareWebTest`). + +## Deployment + +See [DEPLOY.md](DEPLOY.md) for production cutover (`/var/www/ladill-care`, Gitea CI, +nginx vhost, platform onboarding). + +## API + +REST API under `/api/v1` (Sanctum + organization setup middleware). Health check: +`GET /api/health`. diff --git a/app/Contracts/Printers/PrinterDriverInterface.php b/app/Contracts/Printers/PrinterDriverInterface.php new file mode 100644 index 0000000..4463082 --- /dev/null +++ b/app/Contracts/Printers/PrinterDriverInterface.php @@ -0,0 +1,13 @@ + $data + */ + public function __construct( + public readonly string $name, + public readonly array $data = [], + ) {} +} diff --git a/app/Http/Controllers/Api/AppointmentController.php b/app/Http/Controllers/Api/AppointmentController.php new file mode 100644 index 0000000..2666a11 --- /dev/null +++ b/app/Http/Controllers/Api/AppointmentController.php @@ -0,0 +1,136 @@ +authorizeAbility($request, 'appointments.view'); + $organization = $this->organization($request); + $branchScope = app(OrganizationResolver::class)->branchScope($this->member($request)); + + $appointments = $this->appointments->list( + $this->ownerRef($request), + $organization->id, + $request->only(['status', 'practitioner_id', 'date', 'patient_id', 'per_page']), + $branchScope, + ); + + return response()->json($appointments); + } + + public function store(Request $request): JsonResponse + { + $this->authorizeAbility($request, 'appointments.manage'); + $organization = $this->organization($request); + + $appointment = $this->appointments->book( + $organization, + $this->ownerRef($request), + $this->validatedAppointmentData($request), + $this->ownerRef($request), + ); + + return response()->json($appointment, 201); + } + + public function walkIn(Request $request): JsonResponse + { + $this->authorizeAbility($request, 'appointments.manage'); + $organization = $this->organization($request); + + $appointment = $this->appointments->walkIn( + $organization, + $this->ownerRef($request), + $this->validatedWalkInData($request), + $this->ownerRef($request), + ); + + return response()->json($appointment, 201); + } + + public function show(Request $request, Appointment $appointment): JsonResponse + { + $this->authorizeAbility($request, 'appointments.view'); + $this->authorizeAppointment($request, $appointment); + + return response()->json($appointment->load(['patient', 'practitioner', 'branch', 'visit', 'consultation'])); + } + + public function checkIn(Request $request, Appointment $appointment): JsonResponse + { + $this->authorizeAbility($request, 'appointments.manage'); + $this->authorizeAppointment($request, $appointment); + + $updated = $this->appointments->checkIn($appointment, $this->ownerRef($request), $this->ownerRef($request)); + + return response()->json($updated); + } + + public function cancel(Request $request, Appointment $appointment): JsonResponse + { + $this->authorizeAbility($request, 'appointments.manage'); + $this->authorizeAppointment($request, $appointment); + + $updated = $this->appointments->cancel($appointment, $this->ownerRef($request), $this->ownerRef($request)); + + return response()->json($updated); + } + + protected function authorizeAppointment(Request $request, Appointment $appointment): void + { + $this->authorizeOwner($request, $appointment); + abort_unless($appointment->organization_id === $this->organization($request)->id, 404); + + $branchScope = app(OrganizationResolver::class)->branchScope($this->member($request)); + if ($branchScope !== null && $appointment->branch_id !== $branchScope) { + abort(404); + } + } + + /** + * @return array + */ + protected function validatedAppointmentData(Request $request): array + { + return $request->validate([ + 'branch_id' => ['required', 'integer', 'exists:care_branches,id'], + 'patient_id' => ['required', 'integer', 'exists:care_patients,id'], + 'practitioner_id' => ['nullable', 'integer', 'exists:care_practitioners,id'], + 'department_id' => ['nullable', 'integer', 'exists:care_departments,id'], + 'scheduled_at' => ['required', 'date', 'after:now'], + 'reason' => ['nullable', 'string', 'max:1000'], + 'notes' => ['nullable', 'string', 'max:5000'], + ]); + } + + /** + * @return array + */ + protected function validatedWalkInData(Request $request): array + { + return $request->validate([ + 'branch_id' => ['required', 'integer', 'exists:care_branches,id'], + 'patient_id' => ['required', 'integer', 'exists:care_patients,id'], + 'practitioner_id' => ['nullable', 'integer', 'exists:care_practitioners,id'], + 'department_id' => ['nullable', 'integer', 'exists:care_departments,id'], + 'reason' => ['nullable', 'string', 'max:1000'], + 'notes' => ['nullable', 'string', 'max:5000'], + ]); + } +} diff --git a/app/Http/Controllers/Api/BillController.php b/app/Http/Controllers/Api/BillController.php new file mode 100644 index 0000000..1c5c0bd --- /dev/null +++ b/app/Http/Controllers/Api/BillController.php @@ -0,0 +1,86 @@ +authorizeAbility($request, 'bills.view'); + $organization = $this->organization($request); + $branchScope = app(OrganizationResolver::class)->branchScope($this->member($request)); + + $bills = $this->bills->list( + $this->ownerRef($request), + $organization->id, + $request->only(['status', 'patient_id', 'per_page']), + $branchScope, + ); + + return response()->json($bills); + } + + public function generate(Request $request, Visit $visit): JsonResponse + { + $this->authorizeAbility($request, 'bills.manage'); + $this->authorizeVisit($request, $visit); + + $bill = $this->bills->generateFromVisit($visit, $this->ownerRef($request), $this->ownerRef($request)); + + return response()->json($bill, 201); + } + + public function show(Request $request, Bill $bill): JsonResponse + { + $this->authorizeAbility($request, 'bills.view'); + $this->authorizeBill($request, $bill); + + return response()->json($bill->load(['patient', 'lineItems', 'payments'])); + } + + public function recordPayment(Request $request, Bill $bill): JsonResponse + { + $this->authorizeAbility($request, 'payments.manage'); + $this->authorizeBill($request, $bill); + + $payment = $this->bills->recordPayment( + $bill, + $this->ownerRef($request), + $request->validate([ + 'amount_minor' => ['required', 'integer', 'min:1'], + 'method' => ['required', 'string', 'in:'.implode(',', array_keys(config('care.payment_methods')))], + 'reference' => ['nullable', 'string', 'max:100'], + ]), + $this->ownerRef($request), + ); + + return response()->json($payment, 201); + } + + protected function authorizeBill(Request $request, Bill $bill): void + { + $this->authorizeOwner($request, $bill); + abort_unless($bill->organization_id === $this->organization($request)->id, 404); + } + + protected function authorizeVisit(Request $request, Visit $visit): void + { + $this->authorizeOwner($request, $visit); + abort_unless($visit->organization_id === $this->organization($request)->id, 404); + } +} diff --git a/app/Http/Controllers/Api/Concerns/ScopesApiToAccount.php b/app/Http/Controllers/Api/Concerns/ScopesApiToAccount.php new file mode 100644 index 0000000..2e14860 --- /dev/null +++ b/app/Http/Controllers/Api/Concerns/ScopesApiToAccount.php @@ -0,0 +1,44 @@ +user()->public_id; + } + + protected function organization(Request $request): Organization + { + $organization = app(OrganizationResolver::class)->resolveForUser($request->user()); + abort_unless($organization, 404); + + return $organization; + } + + protected function member(Request $request): ?Member + { + return app(OrganizationResolver::class)->memberFor($request->user(), $this->organization($request)); + } + + protected function authorizeAbility(Request $request, string $ability): void + { + abort_unless( + app(CarePermissions::class)->can($this->member($request), $ability), + 403, + ); + } + + protected function authorizeOwner(Request $request, Model $model): void + { + abort_unless($model->getAttribute('owner_ref') === $this->ownerRef($request), 404); + } +} diff --git a/app/Http/Controllers/Api/ConsultationController.php b/app/Http/Controllers/Api/ConsultationController.php new file mode 100644 index 0000000..a0e91b6 --- /dev/null +++ b/app/Http/Controllers/Api/ConsultationController.php @@ -0,0 +1,137 @@ +authorizeAbility($request, 'consultations.view'); + $this->authorizeConsultation($request, $consultation); + + return response()->json($consultation->load([ + 'patient', 'practitioner', 'visit', 'appointment', + 'vitalSigns', 'diagnoses', 'documents', + ])); + } + + public function start(Request $request, Appointment $appointment): JsonResponse + { + $this->authorizeAbility($request, 'consultations.manage'); + $this->authorizeAppointment($request, $appointment); + + $practitionerId = $request->input('practitioner_id') + ? (int) $request->input('practitioner_id') + : $appointment->practitioner_id; + + $this->appointments->startConsultation( + $appointment, + $this->ownerRef($request), + $practitionerId, + $this->ownerRef($request), + ); + + $consultation = $this->consultations->startFromAppointment( + $appointment->fresh(), + $this->ownerRef($request), + $this->ownerRef($request), + ); + + return response()->json($consultation, 201); + } + + public function update(Request $request, Consultation $consultation): JsonResponse + { + $this->authorizeAbility($request, 'consultations.manage'); + $this->authorizeConsultation($request, $consultation); + + $updated = $this->consultations->save( + $consultation, + $this->ownerRef($request), + $this->validatedConsultationData($request), + $this->ownerRef($request), + ); + + return response()->json($updated); + } + + public function complete(Request $request, Consultation $consultation): JsonResponse + { + $this->authorizeAbility($request, 'consultations.manage'); + $this->authorizeConsultation($request, $consultation); + + $completed = $this->consultations->complete( + $consultation, + $this->ownerRef($request), + $this->ownerRef($request), + ); + + return response()->json($completed); + } + + protected function authorizeAppointment(Request $request, Appointment $appointment): void + { + $this->authorizeOwner($request, $appointment); + abort_unless($appointment->organization_id === $this->organization($request)->id, 404); + + $branchScope = app(OrganizationResolver::class)->branchScope($this->member($request)); + if ($branchScope !== null && $appointment->branch_id !== $branchScope) { + abort(404); + } + } + + protected function authorizeConsultation(Request $request, Consultation $consultation): void + { + $this->authorizeOwner($request, $consultation); + $consultation->loadMissing('visit'); + abort_unless($consultation->visit->organization_id === $this->organization($request)->id, 404); + + $branchScope = app(OrganizationResolver::class)->branchScope($this->member($request)); + if ($branchScope !== null && $consultation->visit->branch_id !== $branchScope) { + abort(404); + } + } + + /** + * @return array + */ + protected function validatedConsultationData(Request $request): array + { + return $request->validate([ + 'symptoms' => ['nullable', 'string', 'max:10000'], + 'clinical_notes' => ['nullable', 'string', 'max:20000'], + 'practitioner_id' => ['nullable', 'integer', 'exists:care_practitioners,id'], + 'vitals' => ['nullable', 'array'], + 'vitals.bp_systolic' => ['nullable', 'integer', 'min:50', 'max:300'], + 'vitals.bp_diastolic' => ['nullable', 'integer', 'min:30', 'max:200'], + 'vitals.pulse' => ['nullable', 'integer', 'min:20', 'max:250'], + 'vitals.temperature' => ['nullable', 'numeric', 'min:30', 'max:45'], + 'vitals.weight_kg' => ['nullable', 'numeric', 'min:0', 'max:500'], + 'vitals.height_cm' => ['nullable', 'numeric', 'min:0', 'max:300'], + 'vitals.spo2' => ['nullable', 'integer', 'min:50', 'max:100'], + 'vitals.respiratory_rate' => ['nullable', 'integer', 'min:5', 'max:80'], + 'diagnoses' => ['nullable', 'array'], + 'diagnoses.*.code' => ['nullable', 'string', 'max:50'], + 'diagnoses.*.description' => ['nullable', 'string', 'max:500'], + 'diagnoses.*.is_primary' => ['nullable', 'boolean'], + 'diagnoses.*.notes' => ['nullable', 'string', 'max:2000'], + ]); + } +} diff --git a/app/Http/Controllers/Api/DrugController.php b/app/Http/Controllers/Api/DrugController.php new file mode 100644 index 0000000..2c47dec --- /dev/null +++ b/app/Http/Controllers/Api/DrugController.php @@ -0,0 +1,67 @@ +authorizeAbility($request, 'pharmacy.view'); + $organization = $this->organization($request); + + $drugs = $this->pharmacy->listDrugs( + $this->ownerRef($request), + $organization->id, + $request->only(['q', 'per_page']), + ); + + return response()->json($drugs); + } + + public function store(Request $request): JsonResponse + { + $this->authorizeAbility($request, 'pharmacy.manage'); + + $drug = $this->pharmacy->createDrug( + $this->organization($request), + $this->ownerRef($request), + $request->validate([ + 'name' => ['required', 'string', 'max:255'], + 'generic_name' => ['nullable', 'string', 'max:255'], + 'sku' => ['nullable', 'string', 'max:100'], + 'unit_price_minor' => ['nullable', 'integer', 'min:0'], + ]), + ); + + return response()->json($drug, 201); + } + + public function dispense(Request $request, Prescription $prescription): JsonResponse + { + $this->authorizeAbility($request, 'prescriptions.dispense'); + $this->authorizeOwner($request, $prescription); + + $updated = $this->pharmacy->dispensePrescription( + $prescription, + $this->ownerRef($request), + $request->input('allocations', []), + $this->ownerRef($request), + ); + + return response()->json($updated); + } +} diff --git a/app/Http/Controllers/Api/InvestigationController.php b/app/Http/Controllers/Api/InvestigationController.php new file mode 100644 index 0000000..a841d14 --- /dev/null +++ b/app/Http/Controllers/Api/InvestigationController.php @@ -0,0 +1,171 @@ +authorizeAbility($request, 'lab.view'); + $organization = $this->organization($request); + + $types = InvestigationType::owned($this->ownerRef($request)) + ->where('organization_id', $organization->id) + ->where('is_active', true) + ->orderBy('name') + ->get(); + + return response()->json(['data' => $types]); + } + + public function index(Request $request): JsonResponse + { + $this->authorizeAbility($request, 'lab.view'); + $organization = $this->organization($request); + $branchScope = app(OrganizationResolver::class)->branchScope($this->member($request)); + + $requests = $this->investigations->list( + $this->ownerRef($request), + $organization->id, + $request->only(['status', 'patient_id', 'per_page']), + $branchScope, + ); + + return response()->json($requests); + } + + public function queue(Request $request): JsonResponse + { + $this->authorizeAbility($request, 'lab.manage'); + + $validated = $request->validate([ + 'branch_id' => ['required', 'integer', 'exists:care_branches,id'], + 'status' => ['nullable', 'string'], + ]); + + $queue = $this->investigations->workQueue( + $this->ownerRef($request), + (int) $validated['branch_id'], + $validated['status'] ?? null, + ); + + return response()->json(['data' => $queue]); + } + + public function store(Request $request, Consultation $consultation): JsonResponse + { + $this->authorizeAbility($request, 'investigations.request'); + $this->authorizeConsultation($request, $consultation); + + $validated = $request->validate([ + 'investigation_type_ids' => ['required', 'array', 'min:1'], + 'investigation_type_ids.*' => ['integer', 'exists:care_investigation_types,id'], + 'clinical_notes' => ['nullable', 'string', 'max:2000'], + 'priority' => ['nullable', 'string', 'in:routine,urgent'], + ]); + + $created = $this->investigations->requestFromConsultation( + $consultation, + $this->ownerRef($request), + $validated['investigation_type_ids'], + $validated['clinical_notes'] ?? null, + $validated['priority'] ?? 'routine', + $this->ownerRef($request), + ); + + return response()->json(['data' => $created], 201); + } + + public function show(Request $request, InvestigationRequest $investigation): JsonResponse + { + $this->authorizeAbility($request, 'lab.view'); + $this->authorizeInvestigation($request, $investigation); + + return response()->json($investigation->load([ + 'patient', 'investigationType', 'result.values', 'result.attachments', + ])); + } + + public function collectSample(Request $request, InvestigationRequest $investigation): JsonResponse + { + $this->authorizeAbility($request, 'lab.manage'); + $this->authorizeInvestigation($request, $investigation); + + $updated = $this->investigations->collectSample( + $investigation, + $this->ownerRef($request), + $request->input('sample_barcode'), + $this->ownerRef($request), + ); + + return response()->json($updated); + } + + public function enterResults(Request $request, InvestigationRequest $investigation): JsonResponse + { + $this->authorizeAbility($request, 'lab.manage'); + $this->authorizeInvestigation($request, $investigation); + + $validated = $request->validate([ + 'value' => ['nullable', 'string', 'max:255'], + 'result_summary' => ['nullable', 'string', 'max:5000'], + 'interpretation' => ['nullable', 'string', 'max:5000'], + 'values' => ['nullable', 'array'], + ]); + + $result = $this->investigations->enterResults( + $investigation, + $this->ownerRef($request), + $validated, + $this->ownerRef($request), + ); + + return response()->json($result); + } + + public function approve(Request $request, InvestigationRequest $investigation): JsonResponse + { + $this->authorizeAbility($request, 'lab.manage'); + $this->authorizeInvestigation($request, $investigation); + + $updated = $this->investigations->approve($investigation, $this->ownerRef($request), $this->ownerRef($request)); + + return response()->json($updated); + } + + protected function authorizeConsultation(Request $request, Consultation $consultation): void + { + $this->authorizeOwner($request, $consultation); + $consultation->loadMissing('visit'); + abort_unless($consultation->visit->organization_id === $this->organization($request)->id, 404); + } + + protected function authorizeInvestigation(Request $request, InvestigationRequest $investigation): void + { + $this->authorizeOwner($request, $investigation); + abort_unless($investigation->organization_id === $this->organization($request)->id, 404); + + $branchScope = app(OrganizationResolver::class)->branchScope($this->member($request)); + if ($branchScope !== null && $investigation->branch_id !== $branchScope) { + abort(404); + } + } +} diff --git a/app/Http/Controllers/Api/PatientController.php b/app/Http/Controllers/Api/PatientController.php new file mode 100644 index 0000000..4ecabea --- /dev/null +++ b/app/Http/Controllers/Api/PatientController.php @@ -0,0 +1,123 @@ +authorizeAbility($request, 'patients.view'); + $organization = $this->organization($request); + $branchScope = app(OrganizationResolver::class)->branchScope($this->member($request)); + + $patients = $this->patients->search( + $this->ownerRef($request), + $organization->id, + $request->only(['q', 'patient_number', 'phone', 'national_id', 'date_of_birth', 'per_page']), + $branchScope, + ); + + return response()->json($patients); + } + + public function store(Request $request): JsonResponse + { + $this->authorizeAbility($request, 'patients.manage'); + $organization = $this->organization($request); + + $patient = $this->patients->create( + $organization, + $this->ownerRef($request), + $this->validatedPatientData($request), + $this->ownerRef($request), + ); + + return response()->json($patient, 201); + } + + public function show(Request $request, Patient $patient): JsonResponse + { + $this->authorizeAbility($request, 'patients.view'); + $this->authorizePatient($request, $patient); + + return response()->json($this->patients->dashboard($patient)); + } + + public function update(Request $request, Patient $patient): JsonResponse + { + $this->authorizeAbility($request, 'patients.manage'); + $this->authorizePatient($request, $patient); + + $updated = $this->patients->update( + $patient, + $this->ownerRef($request), + $this->validatedPatientData($request), + $this->ownerRef($request), + ); + + return response()->json($updated); + } + + public function destroy(Request $request, Patient $patient): JsonResponse + { + $this->authorizeAbility($request, 'patients.manage'); + $this->authorizePatient($request, $patient); + + $this->patients->delete($patient, $this->ownerRef($request), $this->ownerRef($request)); + + return response()->json(['message' => 'Patient archived.']); + } + + protected function authorizePatient(Request $request, Patient $patient): void + { + $this->authorizeOwner($request, $patient); + abort_unless($patient->organization_id === $this->organization($request)->id, 404); + + $branchScope = app(OrganizationResolver::class)->branchScope($this->member($request)); + if ($branchScope !== null && $patient->branch_id !== $branchScope) { + abort(404); + } + } + + /** + * @return array + */ + protected function validatedPatientData(Request $request): array + { + return $request->validate([ + 'branch_id' => ['nullable', 'integer', 'exists:care_branches,id'], + 'first_name' => ['required', 'string', 'max:100'], + 'last_name' => ['required', 'string', 'max:100'], + 'other_names' => ['nullable', 'string', 'max:100'], + 'gender' => ['nullable', 'string', 'in:'.implode(',', array_keys(config('care.genders')))], + 'date_of_birth' => ['nullable', 'date', 'before:today'], + 'phone' => ['nullable', 'string', 'max:30'], + 'email' => ['nullable', 'email', 'max:255'], + 'national_id' => ['nullable', 'string', 'max:50'], + 'address' => ['nullable', 'string', 'max:500'], + 'city' => ['nullable', 'string', 'max:100'], + 'region' => ['nullable', 'string', 'max:100'], + 'notes' => ['nullable', 'string', 'max:5000'], + 'allergies' => ['nullable', 'array'], + 'conditions' => ['nullable', 'array'], + 'family_history' => ['nullable', 'array'], + 'emergency_contacts' => ['nullable', 'array'], + 'insurance' => ['nullable', 'array'], + ]); + } +} diff --git a/app/Http/Controllers/Api/PrescriptionController.php b/app/Http/Controllers/Api/PrescriptionController.php new file mode 100644 index 0000000..60d6e1f --- /dev/null +++ b/app/Http/Controllers/Api/PrescriptionController.php @@ -0,0 +1,114 @@ +authorizeAbility($request, 'prescriptions.view'); + $organization = $this->organization($request); + $branchScope = app(OrganizationResolver::class)->branchScope($this->member($request)); + + $prescriptions = $this->prescriptions->list( + $this->ownerRef($request), + $organization->id, + $request->only(['status', 'patient_id', 'per_page']), + $branchScope, + ); + + return response()->json($prescriptions); + } + + public function queue(Request $request): JsonResponse + { + $this->authorizeAbility($request, 'prescriptions.view'); + $organization = $this->organization($request); + + $queue = $this->prescriptions->pharmacyQueue($this->ownerRef($request), $organization->id); + + return response()->json(['data' => $queue]); + } + + public function store(Request $request, Consultation $consultation): JsonResponse + { + $this->authorizeAbility($request, 'prescriptions.manage'); + $this->authorizeConsultation($request, $consultation); + + $prescription = $this->prescriptions->createFromConsultation( + $consultation, + $this->ownerRef($request), + $this->validatedPrescriptionData($request), + $this->ownerRef($request), + ); + + return response()->json($prescription, 201); + } + + public function show(Request $request, Prescription $prescription): JsonResponse + { + $this->authorizeAbility($request, 'prescriptions.view'); + $this->authorizePrescription($request, $prescription); + + return response()->json($prescription->load(['patient', 'practitioner', 'items'])); + } + + public function dispense(Request $request, Prescription $prescription): JsonResponse + { + $this->authorizeAbility($request, 'prescriptions.dispense'); + $this->authorizePrescription($request, $prescription); + + $updated = $this->prescriptions->dispense($prescription, $this->ownerRef($request), $this->ownerRef($request)); + + return response()->json($updated); + } + + protected function authorizeConsultation(Request $request, Consultation $consultation): void + { + $this->authorizeOwner($request, $consultation); + $consultation->loadMissing('visit'); + abort_unless($consultation->visit->organization_id === $this->organization($request)->id, 404); + } + + protected function authorizePrescription(Request $request, Prescription $prescription): void + { + $this->authorizeOwner($request, $prescription); + abort_unless($prescription->organization_id === $this->organization($request)->id, 404); + } + + /** + * @return array + */ + protected function validatedPrescriptionData(Request $request): array + { + return $request->validate([ + 'practitioner_id' => ['nullable', 'integer', 'exists:care_practitioners,id'], + 'notes' => ['nullable', 'string', 'max:5000'], + 'activate' => ['nullable', 'boolean'], + 'items' => ['required', 'array', 'min:1'], + 'items.*.is_procedure' => ['nullable', 'boolean'], + 'items.*.name' => ['required', 'string', 'max:255'], + 'items.*.dosage' => ['nullable', 'string', 'max:100'], + 'items.*.frequency' => ['nullable', 'string', 'max:100'], + 'items.*.duration' => ['nullable', 'string', 'max:100'], + 'items.*.route' => ['nullable', 'string', 'max:50'], + 'items.*.quantity' => ['nullable', 'string', 'max:50'], + 'items.*.instructions' => ['nullable', 'string', 'max:2000'], + ]); + } +} diff --git a/app/Http/Controllers/Api/QueueController.php b/app/Http/Controllers/Api/QueueController.php new file mode 100644 index 0000000..a66b4f9 --- /dev/null +++ b/app/Http/Controllers/Api/QueueController.php @@ -0,0 +1,36 @@ +authorizeAbility($request, 'appointments.view'); + + $validated = $request->validate([ + 'branch_id' => ['required', 'integer', 'exists:care_branches,id'], + 'practitioner_id' => ['nullable', 'integer', 'exists:care_practitioners,id'], + ]); + + $queue = $this->appointments->queue( + $this->ownerRef($request), + (int) $validated['branch_id'], + isset($validated['practitioner_id']) ? (int) $validated['practitioner_id'] : null, + ); + + return response()->json(['data' => $queue]); + } +} diff --git a/app/Http/Controllers/Api/ServiceEventController.php b/app/Http/Controllers/Api/ServiceEventController.php new file mode 100644 index 0000000..3324f9d --- /dev/null +++ b/app/Http/Controllers/Api/ServiceEventController.php @@ -0,0 +1,35 @@ +header('X-Ladill-Signature', ''); + + if (! ServiceEventSignature::verify($request->getContent(), $signature, $secret)) { + return response()->json(['error' => 'invalid signature'], 401); + } + + $eventId = (string) $request->header('X-Ladill-Event-Id', (string) $request->input('id', '')); + if ($eventId !== '') { + if (Cache::has("svcevt:{$eventId}")) { + return response()->json(['status' => 'duplicate']); + } + Cache::put("svcevt:{$eventId}", true, now()->addDay()); + } + + event(new ServiceEventOccurred((string) $request->input('event'), (array) $request->input('data', []))); + + return response()->json(['status' => 'accepted']); + } +} diff --git a/app/Http/Controllers/Auth/SsoLoginController.php b/app/Http/Controllers/Auth/SsoLoginController.php new file mode 100644 index 0000000..c525780 --- /dev/null +++ b/app/Http/Controllers/Auth/SsoLoginController.php @@ -0,0 +1,293 @@ +query('redirect', route('care.dashboard')); + + if (Auth::check()) { + return $this->safeRedirect($intended, route('care.dashboard')); + } + + if (! $request->boolean('fallback')) { + $request->session()->forget('sso.attempts'); + } + + if ($this->attemptSilentRefresh($request, $intended)) { + return $this->safeRedirect($intended, route('care.dashboard')); + } + + $verifier = Str::random(64); + $state = Str::random(40); + $request->session()->put('sso.verifier', $verifier); + $request->session()->put('sso.state', $state); + $request->session()->put('sso.intended', $intended); + + $challenge = rtrim(strtr(base64_encode(hash('sha256', $verifier, true)), '+/', '-_'), '='); + + $query = [ + 'response_type' => 'code', + 'client_id' => (string) config('services.ladill_sso.client_id'), + 'redirect_uri' => (string) config('services.ladill_sso.redirect'), + 'scope' => 'openid profile email', + 'state' => $state, + 'code_challenge' => $challenge, + 'code_challenge_method' => 'S256', + ]; + + $loginHint = (string) $request->session()->get('sso.login_hint', ''); + if ($loginHint !== '') { + $query['login_hint'] = $loginHint; + } + + if (! $request->boolean('interactive')) { + $query['prompt'] = 'none'; + } + + $authorizeUrl = rtrim((string) config('services.ladill_sso.issuer'), '/').'/oauth/authorize?'.http_build_query($query); + + return redirect()->away($authorizeUrl); + } + + public function callback(Request $request): RedirectResponse + { + $intended = (string) $request->session()->get('sso.intended', route('care.dashboard')); + + if ($request->filled('error')) { + if (in_array($request->query('error'), ['login_required', 'interaction_required', 'consent_required'], true) + && ! $request->boolean('interactive')) { + return redirect()->away((string) config('ladill.marketing_url')); + } + + return $this->finishCallback($request, $intended, (string) $request->query('error_description', $request->query('error'))); + } + + if (! $request->filled('code') + || $request->query('state') !== $request->session()->pull('sso.state')) { + return $this->finishCallback($request, $intended, 'invalid_state'); + } + + $issuer = rtrim((string) config('services.ladill_sso.issuer'), '/'); + + $tokenRes = Http::asForm()->post($issuer.'/oauth/token', [ + 'grant_type' => 'authorization_code', + 'client_id' => (string) config('services.ladill_sso.client_id'), + 'client_secret' => (string) config('services.ladill_sso.client_secret'), + 'redirect_uri' => (string) config('services.ladill_sso.redirect'), + 'code' => (string) $request->query('code'), + 'code_verifier' => (string) $request->session()->pull('sso.verifier'), + ]); + if ($tokenRes->failed()) { + return $this->finishCallback($request, $intended, 'token_exchange_failed'); + } + + $user = $this->loginFromTokenResponse($request, $tokenRes); + if (! $user) { + return $this->finishCallback($request, $intended, 'userinfo_failed'); + } + + Auth::login($user, remember: true); + $request->session()->regenerate(); + $request->session()->forget('sso.attempts'); + + return $this->finishCallback($request, $intended, null); + } + + public function failed(Request $request): View + { + return view('auth.sso-error', [ + 'reason' => (string) $request->session()->get('sso.error', ''), + ]); + } + + public function logout(Request $request): RedirectResponse + { + Auth::logout(); + $request->session()->invalidate(); + $request->session()->regenerateToken(); + + // Per-app sign-out: end only this app's session and keep the platform + // (auth.ladill.com) SSO session alive so "Sign in again" re-auths silently. + return redirect()->route('care.signed-out'); + } + + /** Platform session ended — clear this app and offer silent sign-in again. */ + public function platformSignedOut(Request $request): RedirectResponse + { + Auth::logout(); + $request->session()->invalidate(); + $request->session()->regenerateToken(); + + return redirect()->route('sso.connect', [ + 'redirect' => (string) $request->query('redirect', ''), + ]); + } + + public function logoutBridge(Request $request): View + { + $return = $this->safeReturnUrl((string) $request->query('return', '')); + $hubUrl = 'https://'.config('app.auth_domain').'/logout/sso/hub?'.http_build_query([ + 'embedded' => 1, + 'return' => $return, + ]); + + return view('auth.sso-logout-bridge', [ + 'hubUrl' => $hubUrl, + 'return' => $return, + 'authOrigin' => 'https://'.config('app.auth_domain'), + ]); + } + + public function frontchannelLogout(Request $request): Response|RedirectResponse + { + Auth::logout(); + $request->session()->invalidate(); + $request->session()->regenerateToken(); + + $return = (string) $request->query('return', ''); + $root = (string) config('app.platform_domain', 'ladill.com'); + $host = parse_url($return, PHP_URL_HOST); + if (str_starts_with($return, 'https://') && is_string($host) && ($host === $root || str_ends_with($host, '.'.$root))) { + return redirect()->away($return); + } + + return response('', 204); + } + + private function attemptSilentRefresh(Request $request, string $intended): bool + { + $refreshToken = (string) $request->session()->get('sso.refresh_token', ''); + if ($refreshToken === '') { + return false; + } + + $issuer = rtrim((string) config('services.ladill_sso.issuer'), '/'); + $tokenRes = Http::asForm()->post($issuer.'/oauth/token', [ + 'grant_type' => 'refresh_token', + 'refresh_token' => $refreshToken, + 'client_id' => (string) config('services.ladill_sso.client_id'), + 'client_secret' => (string) config('services.ladill_sso.client_secret'), + 'scope' => 'openid profile email', + ]); + + if ($tokenRes->failed()) { + $request->session()->forget('sso.refresh_token'); + + return false; + } + + $user = $this->loginFromTokenResponse($request, $tokenRes); + + if (! $user) { + return false; + } + + Auth::login($user, remember: true); + $request->session()->put('sso.intended', $intended); + + return true; + } + + private function loginFromTokenResponse(Request $request, HttpResponse $tokenRes): ?User + { + $refreshToken = (string) $tokenRes->json('refresh_token', ''); + if ($refreshToken !== '') { + $request->session()->put('sso.refresh_token', $refreshToken); + } + + $issuer = rtrim((string) config('services.ladill_sso.issuer'), '/'); + $claims = Http::withToken((string) $tokenRes->json('access_token'))->acceptJson()->get($issuer.'/oauth/userinfo'); + if ($claims->failed() || ! $claims->json('sub')) { + return null; + } + + $email = (string) ($claims->json('email') ?: ''); + if ($email !== '') { + $request->session()->put('sso.login_hint', $email); + } + + return User::updateOrCreate( + ['public_id' => (string) $claims->json('sub')], + [ + 'name' => $claims->json('name'), + 'email' => $email !== '' ? $email : (string) $claims->json('sub').'@users.ladill.com', + 'avatar_url' => $claims->json('picture'), + ], + ); + } + + private function finishCallback(Request $request, string $intended, ?string $error = null): RedirectResponse + { + if ($error) { + $attempts = (int) $request->session()->get('sso.attempts', 0) + 1; + + if ($attempts >= self::MAX_SSO_ATTEMPTS) { + $request->session()->forget(['sso.attempts', 'sso.state', 'sso.verifier', 'sso.intended']); + $request->session()->flash('sso.error', $error); + + return redirect()->route('sso.failed'); + } + + $request->session()->put('sso.attempts', $attempts); + + return redirect()->route('sso.connect', [ + 'redirect' => $intended, + 'interactive' => 1, + 'fallback' => 1, + ]); + } + + return $this->safeRedirect($intended, route('care.dashboard')); + } + + private function safeReturnUrl(string $url): string + { + $host = parse_url($url, PHP_URL_HOST); + $root = (string) config('app.platform_domain', 'ladill.com'); + + if (is_string($host) && str_starts_with($url, 'https://') + && ($host === $root || str_ends_with($host, '.'.$root))) { + return $url; + } + + return route('care.signed-out'); + } + + private function safeRedirect(string $url, string $fallback): RedirectResponse + { + $host = parse_url($url, PHP_URL_HOST); + $root = (string) config('app.platform_domain', 'ladill.com'); + + if (is_string($host) && str_starts_with($url, 'https://') + && ($host === $root || str_ends_with($host, '.'.$root))) { + return redirect()->away($url); + } + + return redirect()->away($fallback); + } +} diff --git a/app/Http/Controllers/Care/AppointmentController.php b/app/Http/Controllers/Care/AppointmentController.php new file mode 100644 index 0000000..46ed493 --- /dev/null +++ b/app/Http/Controllers/Care/AppointmentController.php @@ -0,0 +1,242 @@ +authorizeAbility($request, 'appointments.view'); + $organization = $this->organization($request); + $branchScope = app(OrganizationResolver::class)->branchScope($this->member($request)); + + $appointments = $this->appointments->list( + $this->ownerRef($request), + $organization->id, + $request->only(['status', 'practitioner_id', 'date', 'patient_id']), + $branchScope, + ); + + $practitioners = $this->activePractitioners($request, $organization->id); + + return view('care.appointments.index', [ + 'organization' => $organization, + 'appointments' => $appointments, + 'practitioners' => $practitioners, + 'statuses' => config('care.appointment_statuses'), + ]); + } + + public function create(Request $request): View + { + $this->authorizeAbility($request, 'appointments.manage'); + $organization = $this->organization($request); + + return view('care.appointments.create', $this->formData($request, $organization)); + } + + public function store(Request $request): RedirectResponse + { + $this->authorizeAbility($request, 'appointments.manage'); + $organization = $this->organization($request); + $validated = $this->validatedAppointmentData($request); + + $appointment = $this->appointments->book( + $organization, + $this->ownerRef($request), + $validated, + $this->ownerRef($request), + ); + + return redirect()->route('care.appointments.show', $appointment) + ->with('success', 'Appointment booked.'); + } + + public function walkInCreate(Request $request): View + { + $this->authorizeAbility($request, 'appointments.manage'); + $organization = $this->organization($request); + + return view('care.appointments.walk-in', $this->formData($request, $organization)); + } + + public function walkInStore(Request $request): RedirectResponse + { + $this->authorizeAbility($request, 'appointments.manage'); + $organization = $this->organization($request); + $validated = $this->validatedWalkInData($request); + + $appointment = $this->appointments->walkIn( + $organization, + $this->ownerRef($request), + $validated, + $this->ownerRef($request), + ); + + return redirect()->route('care.queue.index') + ->with('success', 'Walk-in added to queue.'); + } + + public function show(Request $request, Appointment $appointment): View + { + $this->authorizeAbility($request, 'appointments.view'); + $this->authorizeAppointment($request, $appointment); + + $appointment->load(['patient', 'practitioner', 'branch', 'department', 'visit', 'consultation']); + + $canManage = app(\App\Services\Care\CarePermissions::class) + ->can($this->member($request), 'appointments.manage'); + $canConsult = app(\App\Services\Care\CarePermissions::class) + ->can($this->member($request), 'consultations.manage'); + + return view('care.appointments.show', [ + 'appointment' => $appointment, + 'statuses' => config('care.appointment_statuses'), + 'canManage' => $canManage, + 'canConsult' => $canConsult, + ]); + } + + public function checkIn(Request $request, Appointment $appointment): RedirectResponse + { + $this->authorizeAbility($request, 'appointments.manage'); + $this->authorizeAppointment($request, $appointment); + + $this->appointments->checkIn($appointment, $this->ownerRef($request), $this->ownerRef($request)); + + return redirect()->route('care.queue.index') + ->with('success', 'Patient checked in and added to queue.'); + } + + public function cancel(Request $request, Appointment $appointment): RedirectResponse + { + $this->authorizeAbility($request, 'appointments.manage'); + $this->authorizeAppointment($request, $appointment); + + $this->appointments->cancel($appointment, $this->ownerRef($request), $this->ownerRef($request)); + + return back()->with('success', 'Appointment cancelled.'); + } + + public function noShow(Request $request, Appointment $appointment): RedirectResponse + { + $this->authorizeAbility($request, 'appointments.manage'); + $this->authorizeAppointment($request, $appointment); + + $this->appointments->markNoShow($appointment, $this->ownerRef($request), $this->ownerRef($request)); + + return back()->with('success', 'Marked as no-show.'); + } + + protected function authorizeAppointment(Request $request, Appointment $appointment): void + { + $this->authorizeOwner($request, $appointment); + abort_unless($appointment->organization_id === $this->organization($request)->id, 404); + + $branchId = app(OrganizationResolver::class)->branchScope($this->member($request)); + if ($branchId !== null && $appointment->branch_id !== $branchId) { + abort(404); + } + } + + /** + * @return array + */ + protected function formData(Request $request, \App\Models\Organization $organization): array + { + $ownerRef = $this->ownerRef($request); + $branchQuery = Branch::owned($ownerRef)->where('organization_id', $organization->id)->where('is_active', true); + + $branchScope = app(OrganizationResolver::class)->branchScope($this->member($request)); + if ($branchScope !== null) { + $branchQuery->where('id', $branchScope); + } + + $branches = $branchQuery->orderBy('name')->get(); + $defaultBranch = $branchScope ?? $branches->first()?->id; + + $patients = Patient::owned($ownerRef) + ->where('organization_id', $organization->id) + ->when($branchScope, fn ($q) => $q->where('branch_id', $branchScope)) + ->orderBy('first_name') + ->limit(200) + ->get(); + + $departments = Department::owned($ownerRef) + ->whereIn('branch_id', $branches->pluck('id')) + ->where('is_active', true) + ->orderBy('name') + ->get(); + + return [ + 'organization' => $organization, + 'branches' => $branches, + 'defaultBranch' => $defaultBranch, + 'patients' => $patients, + 'practitioners' => $this->activePractitioners($request, $organization->id), + 'departments' => $departments, + ]; + } + + /** + * @return \Illuminate\Database\Eloquent\Collection + */ + protected function activePractitioners(Request $request, int $organizationId) + { + return Practitioner::owned($this->ownerRef($request)) + ->where('organization_id', $organizationId) + ->where('is_active', true) + ->orderBy('name') + ->get(); + } + + /** + * @return array + */ + protected function validatedAppointmentData(Request $request): array + { + return $request->validate([ + 'branch_id' => ['required', 'integer', 'exists:care_branches,id'], + 'patient_id' => ['required', 'integer', 'exists:care_patients,id'], + 'practitioner_id' => ['nullable', 'integer', 'exists:care_practitioners,id'], + 'department_id' => ['nullable', 'integer', 'exists:care_departments,id'], + 'scheduled_at' => ['required', 'date', 'after:now'], + 'reason' => ['nullable', 'string', 'max:1000'], + 'notes' => ['nullable', 'string', 'max:5000'], + ]); + } + + /** + * @return array + */ + protected function validatedWalkInData(Request $request): array + { + return $request->validate([ + 'branch_id' => ['required', 'integer', 'exists:care_branches,id'], + 'patient_id' => ['required', 'integer', 'exists:care_patients,id'], + 'practitioner_id' => ['nullable', 'integer', 'exists:care_practitioners,id'], + 'department_id' => ['nullable', 'integer', 'exists:care_departments,id'], + 'reason' => ['nullable', 'string', 'max:1000'], + 'notes' => ['nullable', 'string', 'max:5000'], + ]); + } +} diff --git a/app/Http/Controllers/Care/AuditLogController.php b/app/Http/Controllers/Care/AuditLogController.php new file mode 100644 index 0000000..c1b53b1 --- /dev/null +++ b/app/Http/Controllers/Care/AuditLogController.php @@ -0,0 +1,76 @@ +authorizeAbility($request, 'audit.view'); + $organization = $this->organization($request); + + $logs = $this->query($request, $organization)->paginate(50)->withQueryString(); + + return view('care.audit.index', [ + 'logs' => $logs, + 'organization' => $organization, + 'actions' => config('care.audit_actions'), + 'canExport' => app(CarePermissions::class)->can($this->member($request), 'audit.export'), + ]); + } + + public function export(Request $request): StreamedResponse + { + $this->authorizeAbility($request, 'audit.export'); + $organization = $this->organization($request); + + $filename = 'care-audit-'.now()->format('Y-m-d-His').'.csv'; + + return response()->streamDownload(function () use ($request, $organization) { + $handle = fopen('php://output', 'w'); + fputcsv($handle, ['Time', 'Action', 'Actor', 'Subject', 'Metadata', 'IP']); + + $this->query($request, $organization)->chunk(200, function ($logs) use ($handle) { + foreach ($logs as $log) { + fputcsv($handle, [ + $log->created_at?->toDateTimeString(), + $log->action, + $log->actor_ref ?? '—', + $log->subject_type ? class_basename($log->subject_type).' #'.$log->subject_id : '—', + json_encode($log->metadata ?? []), + $log->ip_address ?? '—', + ]); + } + }); + + fclose($handle); + }, $filename, ['Content-Type' => 'text/csv']); + } + + protected function query(Request $request, $organization) + { + return AuditLog::owned($this->ownerRef($request)) + ->where('organization_id', $organization->id) + ->when($request->action, fn ($q, $action) => $q->where('action', $action)) + ->when($request->from, fn ($q, $from) => $q->where('created_at', '>=', Carbon::parse($from)->startOfDay())) + ->when($request->to, fn ($q, $to) => $q->where('created_at', '<=', Carbon::parse($to)->endOfDay())) + ->when($request->q, function ($q, $search) { + $q->where(function ($inner) use ($search) { + $inner->where('action', 'like', "%{$search}%") + ->orWhere('metadata', 'like', "%{$search}%"); + }); + }) + ->orderByDesc('created_at'); + } +} diff --git a/app/Http/Controllers/Care/BillController.php b/app/Http/Controllers/Care/BillController.php new file mode 100644 index 0000000..04dc7a5 --- /dev/null +++ b/app/Http/Controllers/Care/BillController.php @@ -0,0 +1,176 @@ +authorizeAbility($request, 'bills.view'); + $organization = $this->organization($request); + $branchScope = app(OrganizationResolver::class)->branchScope($this->member($request)); + + $bills = $this->bills->list( + $this->ownerRef($request), + $organization->id, + $request->only(['status', 'patient_id']), + $branchScope, + ); + + return view('care.bills.index', [ + 'organization' => $organization, + 'bills' => $bills, + 'statuses' => config('care.bill_statuses'), + ]); + } + + public function generate(Request $request, Visit $visit): RedirectResponse + { + $this->authorizeAbility($request, 'bills.manage'); + $this->authorizeVisit($request, $visit); + + $bill = $this->bills->generateFromVisit($visit, $this->ownerRef($request), $this->ownerRef($request)); + + return redirect()->route('care.bills.show', $bill) + ->with('success', 'Bill generated from visit.'); + } + + public function show(Request $request, Bill $bill): View + { + $this->authorizeAbility($request, 'bills.view'); + $this->authorizeBill($request, $bill); + + $bill->load(['patient', 'branch', 'visit', 'lineItems', 'payments']); + + $canManage = app(\App\Services\Care\CarePermissions::class) + ->can($this->member($request), 'bills.manage'); + $canPay = app(\App\Services\Care\CarePermissions::class) + ->can($this->member($request), 'payments.manage'); + + return view('care.bills.show', [ + 'bill' => $bill, + 'statuses' => config('care.bill_statuses'), + 'lineTypes' => config('care.bill_line_types'), + 'paymentMethods' => config('care.payment_methods'), + 'canManage' => $canManage, + 'canPay' => $canPay, + ]); + } + + public function addLineItem(Request $request, Bill $bill): RedirectResponse + { + $this->authorizeAbility($request, 'bills.manage'); + $this->authorizeBill($request, $bill); + + $this->bills->addManualLineItem( + $bill, + $this->ownerRef($request), + $request->validate([ + 'type' => ['required', 'string', 'in:'.implode(',', array_keys(config('care.bill_line_types')))], + 'description' => ['required', 'string', 'max:255'], + 'quantity' => ['required', 'integer', 'min:1'], + 'unit_price_minor' => ['required', 'integer', 'min:0'], + ]), + $this->ownerRef($request), + ); + + return back()->with('success', 'Line item added.'); + } + + public function applyAdjustments(Request $request, Bill $bill): RedirectResponse + { + $this->authorizeAbility($request, 'bills.manage'); + $this->authorizeBill($request, $bill); + + $validated = $request->validate([ + 'discount_minor' => ['nullable', 'integer', 'min:0'], + 'tax_minor' => ['nullable', 'integer', 'min:0'], + ]); + + $this->bills->applyAdjustments( + $bill, + $this->ownerRef($request), + (int) ($validated['discount_minor'] ?? 0), + (int) ($validated['tax_minor'] ?? 0), + $this->ownerRef($request), + ); + + return back()->with('success', 'Bill updated.'); + } + + public function recordPayment(Request $request, Bill $bill): RedirectResponse + { + $this->authorizeAbility($request, 'payments.manage'); + $this->authorizeBill($request, $bill); + + $this->bills->recordPayment( + $bill, + $this->ownerRef($request), + $request->validate([ + 'amount_minor' => ['required', 'integer', 'min:1'], + 'method' => ['required', 'string', 'in:'.implode(',', array_keys(config('care.payment_methods')))], + 'reference' => ['nullable', 'string', 'max:100'], + 'notes' => ['nullable', 'string', 'max:500'], + ]), + $this->ownerRef($request), + ); + + return back()->with('success', 'Payment recorded.'); + } + + public function void(Request $request, Bill $bill): RedirectResponse + { + $this->authorizeAbility($request, 'bills.manage'); + $this->authorizeBill($request, $bill); + + $this->bills->void($bill, $this->ownerRef($request), $this->ownerRef($request)); + + return redirect()->route('care.bills.index')->with('success', 'Bill voided.'); + } + + public function print(Request $request, Bill $bill): View + { + $this->authorizeAbility($request, 'bills.view'); + $this->authorizeBill($request, $bill); + + $bill->load(['patient', 'branch', 'lineItems', 'payments', 'organization']); + + return view('care.bills.print', [ + 'bill' => $bill, + 'organization' => $this->organization($request), + ]); + } + + protected function authorizeBill(Request $request, Bill $bill): void + { + $this->authorizeOwner($request, $bill); + abort_unless($bill->organization_id === $this->organization($request)->id, 404); + + $branchId = app(OrganizationResolver::class)->branchScope($this->member($request)); + if ($branchId !== null && $bill->branch_id !== $branchId) { + abort(404); + } + } + + protected function authorizeVisit(Request $request, Visit $visit): void + { + $this->authorizeOwner($request, $visit); + abort_unless($visit->organization_id === $this->organization($request)->id, 404); + } +} diff --git a/app/Http/Controllers/Care/BranchController.php b/app/Http/Controllers/Care/BranchController.php new file mode 100644 index 0000000..5ee2708 --- /dev/null +++ b/app/Http/Controllers/Care/BranchController.php @@ -0,0 +1,109 @@ +authorizeAbility($request, 'admin.branches.view'); + $organization = $this->organization($request); + + $branches = Branch::owned($this->ownerRef($request)) + ->where('organization_id', $organization->id) + ->withCount('departments') + ->orderBy('name') + ->get(); + + return view('care.admin.branches.index', compact('branches', 'organization')); + } + + public function create(Request $request): View + { + $this->authorizeAbility($request, 'admin.branches.manage'); + + return view('care.admin.branches.create', ['organization' => $this->organization($request)]); + } + + public function store(Request $request): RedirectResponse + { + $this->authorizeAbility($request, 'admin.branches.manage'); + $organization = $this->organization($request); + $owner = $this->ownerRef($request); + + $currentCount = Branch::owned($owner) + ->where('organization_id', $organization->id) + ->count(); + + if (! app(PlanService::class)->canAddBranch($organization, $currentCount)) { + return back()->withInput()->with('error', 'Your plan allows one branch. Upgrade to Care Pro for unlimited branches.'); + } + + $validated = $request->validate([ + 'name' => ['required', 'string', 'max:255'], + 'code' => ['nullable', 'string', 'max:50'], + 'address' => ['nullable', 'string', 'max:500'], + 'phone' => ['nullable', 'string', 'max:50'], + ]); + + $branch = Branch::create([ + 'owner_ref' => $owner, + 'organization_id' => $organization->id, + ...$validated, + 'is_active' => true, + ]); + + AuditLogger::record($owner, 'branch.created', $organization->id, $owner, Branch::class, $branch->id); + + return redirect()->route('care.branches.index')->with('success', 'Branch created.'); + } + + public function edit(Request $request, Branch $branch): View + { + $this->authorizeAbility($request, 'admin.branches.manage'); + $this->authorizeOwner($request, $branch); + + return view('care.admin.branches.edit', compact('branch')); + } + + public function update(Request $request, Branch $branch): RedirectResponse + { + $this->authorizeAbility($request, 'admin.branches.manage'); + $this->authorizeOwner($request, $branch); + + $validated = $request->validate([ + 'name' => ['required', 'string', 'max:255'], + 'code' => ['nullable', 'string', 'max:50'], + 'address' => ['nullable', 'string', 'max:500'], + 'phone' => ['nullable', 'string', 'max:50'], + 'is_active' => ['boolean'], + ]); + + $branch->update([ + ...$validated, + 'is_active' => $request->boolean('is_active', true), + ]); + + AuditLogger::record( + $this->ownerRef($request), + 'branch.updated', + $branch->organization_id, + $this->ownerRef($request), + Branch::class, + $branch->id, + ); + + return redirect()->route('care.branches.index')->with('success', 'Branch updated.'); + } +} diff --git a/app/Http/Controllers/Care/Concerns/ScopesToAccount.php b/app/Http/Controllers/Care/Concerns/ScopesToAccount.php new file mode 100644 index 0000000..7c09a02 --- /dev/null +++ b/app/Http/Controllers/Care/Concerns/ScopesToAccount.php @@ -0,0 +1,59 @@ +user()->public_id; + } + + protected function organization(Request $request): Organization + { + $organization = $request->attributes->get('care.organization') + ?? app(OrganizationResolver::class)->resolveForUser($request->user()); + + abort_unless($organization, 404); + + return $organization; + } + + protected function member(Request $request): ?Member + { + return $request->attributes->get('care.member') + ?? app(OrganizationResolver::class)->memberFor($request->user(), $this->organization($request)); + } + + protected function authorizeAbility(Request $request, string $ability): void + { + abort_unless( + app(CarePermissions::class)->can($this->member($request), $ability), + 403, + ); + } + + protected function authorizeOwner(Request $request, Model $model): void + { + abort_unless($model->getAttribute('owner_ref') === $this->ownerRef($request), 404); + } + + protected function scopeToBranch(Request $request, Builder $query, string $column = 'branch_id'): Builder + { + $branchId = app(OrganizationResolver::class)->branchScope($this->member($request)); + + if ($branchId !== null) { + $query->where($column, $branchId); + } + + return $query; + } +} diff --git a/app/Http/Controllers/Care/ConsultationController.php b/app/Http/Controllers/Care/ConsultationController.php new file mode 100644 index 0000000..d63c853 --- /dev/null +++ b/app/Http/Controllers/Care/ConsultationController.php @@ -0,0 +1,158 @@ +authorizeAbility($request, 'consultations.view'); + $this->authorizeConsultation($request, $consultation); + + $consultation->load([ + 'patient', 'practitioner', 'visit', 'appointment', + 'vitalSigns', 'diagnoses', 'documents', + 'investigationRequests.investigationType', 'prescriptions.items', + ]); + + $canManage = app(\App\Services\Care\CarePermissions::class) + ->can($this->member($request), 'consultations.manage'); + $canVitals = app(\App\Services\Care\CarePermissions::class) + ->can($this->member($request), 'vitals.manage'); + $canRequestInvestigations = app(\App\Services\Care\CarePermissions::class) + ->can($this->member($request), 'investigations.request'); + $canPrescribe = app(\App\Services\Care\CarePermissions::class) + ->can($this->member($request), 'prescriptions.manage'); + $canGenerateBill = app(\App\Services\Care\CarePermissions::class) + ->can($this->member($request), 'bills.manage'); + + $practitioners = Practitioner::owned($this->ownerRef($request)) + ->where('organization_id', $this->organization($request)->id) + ->where('is_active', true) + ->orderBy('name') + ->get(); + + $investigationTypes = InvestigationType::owned($this->ownerRef($request)) + ->where('organization_id', $this->organization($request)->id) + ->where('is_active', true) + ->orderBy('name') + ->get(); + + return view('care.consultations.show', [ + 'consultation' => $consultation, + 'practitioners' => $practitioners, + 'investigationTypes' => $investigationTypes, + 'canManage' => $canManage, + 'canVitals' => $canVitals, + 'canRequestInvestigations' => $canRequestInvestigations, + 'canPrescribe' => $canPrescribe, + 'canGenerateBill' => $canGenerateBill, + 'isCompleted' => $consultation->status === Consultation::STATUS_COMPLETED, + ]); + } + + public function update(Request $request, Consultation $consultation): RedirectResponse + { + $canManage = app(\App\Services\Care\CarePermissions::class) + ->can($this->member($request), 'consultations.manage'); + $canVitals = app(\App\Services\Care\CarePermissions::class) + ->can($this->member($request), 'vitals.manage'); + + abort_unless($canManage || $canVitals, 403); + $this->authorizeConsultation($request, $consultation); + abort_if($consultation->status === Consultation::STATUS_COMPLETED, 422); + + $validated = $this->validatedConsultationData($request, $canManage, $canVitals); + + $this->consultations->save( + $consultation, + $this->ownerRef($request), + $validated, + $this->ownerRef($request), + ); + + return back()->with('success', 'Consultation saved.'); + } + + public function complete(Request $request, Consultation $consultation): RedirectResponse + { + $this->authorizeAbility($request, 'consultations.manage'); + $this->authorizeConsultation($request, $consultation); + + $this->consultations->complete( + $consultation, + $this->ownerRef($request), + $this->ownerRef($request), + ); + + return redirect()->route('care.patients.show', $consultation->patient) + ->with('success', 'Consultation completed.'); + } + + protected function authorizeConsultation(Request $request, Consultation $consultation): void + { + $this->authorizeOwner($request, $consultation); + $consultation->loadMissing('visit'); + abort_unless($consultation->visit->organization_id === $this->organization($request)->id, 404); + + $branchId = app(OrganizationResolver::class)->branchScope($this->member($request)); + if ($branchId !== null && $consultation->visit->branch_id !== $branchId) { + abort(404); + } + } + + /** + * @return array + */ + protected function validatedConsultationData(Request $request, bool $canManage, bool $canVitals): array + { + $rules = []; + + if ($canManage) { + $rules = array_merge($rules, [ + 'symptoms' => ['nullable', 'string', 'max:10000'], + 'clinical_notes' => ['nullable', 'string', 'max:20000'], + 'practitioner_id' => ['nullable', 'integer', 'exists:care_practitioners,id'], + 'diagnoses' => ['nullable', 'array'], + 'diagnoses.*.code' => ['nullable', 'string', 'max:50'], + 'diagnoses.*.description' => ['nullable', 'string', 'max:500'], + 'diagnoses.*.is_primary' => ['nullable', 'boolean'], + 'diagnoses.*.notes' => ['nullable', 'string', 'max:2000'], + 'documents' => ['nullable', 'array'], + 'documents.*' => ['file', 'max:10240', 'mimes:pdf,jpeg,png,jpg,webp'], + ]); + $canVitals = true; + } + + if ($canVitals) { + $rules['vitals'] = ['nullable', 'array']; + $rules['vitals.bp_systolic'] = ['nullable', 'integer', 'min:50', 'max:300']; + $rules['vitals.bp_diastolic'] = ['nullable', 'integer', 'min:30', 'max:200']; + $rules['vitals.pulse'] = ['nullable', 'integer', 'min:20', 'max:250']; + $rules['vitals.temperature'] = ['nullable', 'numeric', 'min:30', 'max:45']; + $rules['vitals.weight_kg'] = ['nullable', 'numeric', 'min:0', 'max:500']; + $rules['vitals.height_cm'] = ['nullable', 'numeric', 'min:0', 'max:300']; + $rules['vitals.spo2'] = ['nullable', 'integer', 'min:50', 'max:100']; + $rules['vitals.respiratory_rate'] = ['nullable', 'integer', 'min:5', 'max:80']; + } + + return $request->validate($rules); + } +} diff --git a/app/Http/Controllers/Care/DashboardController.php b/app/Http/Controllers/Care/DashboardController.php new file mode 100644 index 0000000..4be4078 --- /dev/null +++ b/app/Http/Controllers/Care/DashboardController.php @@ -0,0 +1,50 @@ +authorizeAbility($request, 'dashboard.view'); + $organization = $this->organization($request); + $owner = $this->ownerRef($request); + + $branchQuery = Branch::owned($owner)->where('organization_id', $organization->id); + $this->scopeToBranch($request, $branchQuery); + + $stats = [ + 'branches' => (clone $branchQuery)->where('is_active', true)->count(), + 'team_members' => Member::owned($owner)->where('organization_id', $organization->id)->count(), + 'departments' => $organization->branches() + ->when(app(OrganizationResolver::class)->branchScope($this->member($request)), function ($q, $branchId) { + $q->where('id', $branchId); + }) + ->withCount('departments') + ->get() + ->sum('departments_count'), + ]; + + $branches = (clone $branchQuery)->withCount('departments')->orderBy('name')->get(); + + $branchScope = app(OrganizationResolver::class)->branchScope($this->member($request)); + $operational = $this->reports->dashboardStats($owner, $organization->id, $branchScope); + + return view('care.dashboard', compact('organization', 'stats', 'branches', 'operational')); + } +} diff --git a/app/Http/Controllers/Care/DepartmentController.php b/app/Http/Controllers/Care/DepartmentController.php new file mode 100644 index 0000000..e15cfbc --- /dev/null +++ b/app/Http/Controllers/Care/DepartmentController.php @@ -0,0 +1,144 @@ +authorizeAbility($request, 'admin.departments.view'); + $organization = $this->organization($request); + $owner = $this->ownerRef($request); + + $departments = Department::owned($owner) + ->whereHas('branch', fn ($q) => $q->where('organization_id', $organization->id)) + ->with('branch') + ->orderBy('name') + ->get(); + + return view('care.admin.departments.index', [ + 'departments' => $departments, + 'organization' => $organization, + 'types' => config('care.department_types'), + ]); + } + + public function create(Request $request): View + { + $this->authorizeAbility($request, 'admin.departments.manage'); + $organization = $this->organization($request); + + $branches = Branch::owned($this->ownerRef($request)) + ->where('organization_id', $organization->id) + ->where('is_active', true) + ->orderBy('name') + ->get(); + + return view('care.admin.departments.create', [ + 'organization' => $organization, + 'branches' => $branches, + 'types' => config('care.department_types'), + ]); + } + + public function store(Request $request): RedirectResponse + { + $this->authorizeAbility($request, 'admin.departments.manage'); + $organization = $this->organization($request); + $owner = $this->ownerRef($request); + + $validated = $request->validate([ + 'branch_id' => ['required', 'integer', 'exists:care_branches,id'], + 'name' => ['required', 'string', 'max:255'], + 'type' => ['required', 'string', 'in:'.implode(',', array_keys(config('care.department_types')))], + ]); + + $branch = Branch::owned($owner)->findOrFail($validated['branch_id']); + abort_unless($branch->organization_id === $organization->id, 404); + + $department = Department::create([ + 'owner_ref' => $owner, + 'branch_id' => $branch->id, + 'name' => $validated['name'], + 'type' => $validated['type'], + 'is_active' => true, + ]); + + AuditLogger::record($owner, 'department.created', $organization->id, $owner, Department::class, $department->id); + + return redirect()->route('care.departments.index')->with('success', 'Department created.'); + } + + public function edit(Request $request, Department $department): View + { + $this->authorizeAbility($request, 'admin.departments.manage'); + $this->authorizeOwner($request, $department); + + return view('care.admin.departments.edit', [ + 'department' => $department, + 'types' => config('care.department_types'), + ]); + } + + public function update(Request $request, Department $department): RedirectResponse + { + $this->authorizeAbility($request, 'admin.departments.manage'); + $this->authorizeOwner($request, $department); + + $validated = $request->validate([ + 'name' => ['required', 'string', 'max:255'], + 'type' => ['required', 'string', 'in:'.implode(',', array_keys(config('care.department_types')))], + 'is_active' => ['boolean'], + ]); + + $department->update([ + ...$validated, + 'is_active' => $request->boolean('is_active', true), + ]); + + AuditLogger::record( + $this->ownerRef($request), + 'department.updated', + $department->branch->organization_id, + $this->ownerRef($request), + Department::class, + $department->id, + ); + + return redirect()->route('care.departments.index')->with('success', 'Department updated.'); + } + + public function destroy(Request $request, Department $department): RedirectResponse + { + $this->authorizeAbility($request, 'admin.departments.manage'); + $this->authorizeOwner($request, $department); + + $department->load('branch'); + $organizationId = $department->branch->organization_id; + $departmentId = $department->id; + + $department->delete(); + + AuditLogger::record( + $this->ownerRef($request), + 'department.deleted', + $organizationId, + $this->ownerRef($request), + Department::class, + $departmentId, + ); + + return redirect()->route('care.departments.index')->with('success', 'Department removed.'); + } +} diff --git a/app/Http/Controllers/Care/DrugController.php b/app/Http/Controllers/Care/DrugController.php new file mode 100644 index 0000000..4facb5c --- /dev/null +++ b/app/Http/Controllers/Care/DrugController.php @@ -0,0 +1,145 @@ +authorizeAbility($request, 'pharmacy.view'); + $organization = $this->organization($request); + $branchScope = app(OrganizationResolver::class)->branchScope($this->member($request)); + + $drugs = $this->pharmacy->listDrugs( + $this->ownerRef($request), + $organization->id, + $request->only(['q']), + $branchScope, + ); + + $lowStock = $this->pharmacy->lowStock($this->ownerRef($request), $organization->id); + $expired = $this->pharmacy->expiredBatches($this->ownerRef($request), $organization->id); + + return view('care.pharmacy.drugs.index', [ + 'organization' => $organization, + 'drugs' => $drugs, + 'lowStock' => $lowStock, + 'expired' => $expired, + 'canManage' => app(\App\Services\Care\CarePermissions::class) + ->can($this->member($request), 'pharmacy.manage'), + ]); + } + + public function create(Request $request): View + { + $this->authorizeAbility($request, 'pharmacy.manage'); + + return view('care.pharmacy.drugs.create', [ + 'organization' => $this->organization($request), + ]); + } + + public function store(Request $request): RedirectResponse + { + $this->authorizeAbility($request, 'pharmacy.manage'); + + $drug = $this->pharmacy->createDrug( + $this->organization($request), + $this->ownerRef($request), + $this->validatedDrugData($request), + ); + + return redirect()->route('care.pharmacy.drugs.show', $drug) + ->with('success', 'Drug added to inventory.'); + } + + public function show(Request $request, Drug $drug): View + { + $this->authorizeAbility($request, 'pharmacy.view'); + $this->authorizeDrug($request, $drug); + + $drug->load(['batches' => fn ($q) => $q->orderBy('expiry_date')]); + + return view('care.pharmacy.drugs.show', [ + 'drug' => $drug, + 'canManage' => app(\App\Services\Care\CarePermissions::class) + ->can($this->member($request), 'pharmacy.manage'), + ]); + } + + public function edit(Request $request, Drug $drug): View + { + $this->authorizeAbility($request, 'pharmacy.manage'); + $this->authorizeDrug($request, $drug); + + return view('care.pharmacy.drugs.edit', ['drug' => $drug]); + } + + public function update(Request $request, Drug $drug): RedirectResponse + { + $this->authorizeAbility($request, 'pharmacy.manage'); + $this->authorizeDrug($request, $drug); + + $this->pharmacy->updateDrug($drug, $this->ownerRef($request), $this->validatedDrugData($request)); + + return redirect()->route('care.pharmacy.drugs.show', $drug) + ->with('success', 'Drug updated.'); + } + + public function receiveBatch(Request $request, Drug $drug): RedirectResponse + { + $this->authorizeAbility($request, 'pharmacy.manage'); + $this->authorizeDrug($request, $drug); + + $this->pharmacy->receiveBatch( + $drug, + $this->ownerRef($request), + $request->validate([ + 'batch_number' => ['required', 'string', 'max:100'], + 'expiry_date' => ['nullable', 'date', 'after:today'], + 'quantity_on_hand' => ['required', 'integer', 'min:1'], + 'cost_minor' => ['nullable', 'integer', 'min:0'], + ]), + $this->ownerRef($request), + ); + + return back()->with('success', 'Stock received.'); + } + + protected function authorizeDrug(Request $request, Drug $drug): void + { + $this->authorizeOwner($request, $drug); + abort_unless($drug->organization_id === $this->organization($request)->id, 404); + } + + /** + * @return array + */ + protected function validatedDrugData(Request $request): array + { + return $request->validate([ + 'name' => ['required', 'string', 'max:255'], + 'generic_name' => ['nullable', 'string', 'max:255'], + 'sku' => ['nullable', 'string', 'max:100'], + 'unit' => ['nullable', 'string', 'max:50'], + 'unit_price_minor' => ['nullable', 'integer', 'min:0'], + 'reorder_level' => ['nullable', 'integer', 'min:0'], + 'is_active' => ['nullable', 'boolean'], + ]); + } +} diff --git a/app/Http/Controllers/Care/InvestigationController.php b/app/Http/Controllers/Care/InvestigationController.php new file mode 100644 index 0000000..963b7d5 --- /dev/null +++ b/app/Http/Controllers/Care/InvestigationController.php @@ -0,0 +1,235 @@ +authorizeAbility($request, 'lab.view'); + $organization = $this->organization($request); + $branchScope = app(OrganizationResolver::class)->branchScope($this->member($request)); + + $requests = $this->investigations->list( + $this->ownerRef($request), + $organization->id, + $request->only(['status', 'patient_id']), + $branchScope, + ); + + return view('care.lab.requests.index', [ + 'organization' => $organization, + 'requests' => $requests, + 'statuses' => config('care.investigation_statuses'), + ]); + } + + public function queue(Request $request): View + { + $this->authorizeAbility($request, 'lab.manage'); + $organization = $this->organization($request); + $branchScope = app(OrganizationResolver::class)->branchScope($this->member($request)); + + $branches = Branch::owned($this->ownerRef($request)) + ->where('organization_id', $organization->id) + ->where('is_active', true) + ->when($branchScope, fn ($q) => $q->where('id', $branchScope)) + ->orderBy('name') + ->get(); + + $branchId = (int) ($request->input('branch_id') ?: $branchScope ?: $branches->first()?->id); + $status = $request->input('status'); + + $queue = $branchId + ? $this->investigations->workQueue($this->ownerRef($request), $branchId, $status) + : collect(); + + return view('care.lab.queue.index', [ + 'organization' => $organization, + 'branches' => $branches, + 'branchId' => $branchId, + 'status' => $status, + 'queue' => $queue, + 'statuses' => config('care.investigation_statuses'), + 'members' => Member::owned($this->ownerRef($request)) + ->where('organization_id', $organization->id) + ->orderBy('role') + ->get(), + ]); + } + + public function requestFromConsultation(Request $request, Consultation $consultation): RedirectResponse + { + $this->authorizeAbility($request, 'investigations.request'); + $this->authorizeConsultation($request, $consultation); + + $validated = $request->validate([ + 'investigation_type_ids' => ['required', 'array', 'min:1'], + 'investigation_type_ids.*' => ['integer', 'exists:care_investigation_types,id'], + 'clinical_notes' => ['nullable', 'string', 'max:2000'], + 'priority' => ['nullable', 'string', 'in:routine,urgent'], + ]); + + $this->investigations->requestFromConsultation( + $consultation, + $this->ownerRef($request), + $validated['investigation_type_ids'], + $validated['clinical_notes'] ?? null, + $validated['priority'] ?? 'routine', + $this->ownerRef($request), + ); + + return back()->with('success', 'Investigation request(s) submitted.'); + } + + public function show(Request $request, InvestigationRequest $investigation): View + { + $this->authorizeAbility($request, 'lab.view'); + $this->authorizeInvestigation($request, $investigation); + + $investigation->load([ + 'patient', 'investigationType', 'practitioner', 'branch', + 'result.values', 'result.attachments', 'assignedMember', + ]); + + $canManage = app(\App\Services\Care\CarePermissions::class) + ->can($this->member($request), 'lab.manage'); + $canViewResults = app(\App\Services\Care\CarePermissions::class) + ->can($this->member($request), 'lab.results.view'); + + return view('care.lab.requests.show', [ + 'investigation' => $investigation, + 'statuses' => config('care.investigation_statuses'), + 'canManage' => $canManage, + 'canViewResults' => $canViewResults, + ]); + } + + public function collectSample(Request $request, InvestigationRequest $investigation): RedirectResponse + { + $this->authorizeAbility($request, 'lab.manage'); + $this->authorizeInvestigation($request, $investigation); + + $validated = $request->validate(['sample_barcode' => ['nullable', 'string', 'max:100']]); + + $this->investigations->collectSample( + $investigation, + $this->ownerRef($request), + $validated['sample_barcode'] ?? null, + $this->ownerRef($request), + ); + + return back()->with('success', 'Sample collected.'); + } + + public function startProcessing(Request $request, InvestigationRequest $investigation): RedirectResponse + { + $this->authorizeAbility($request, 'lab.manage'); + $this->authorizeInvestigation($request, $investigation); + + $validated = $request->validate(['assigned_member_id' => ['nullable', 'integer', 'exists:care_members,id']]); + + $this->investigations->startProcessing( + $investigation, + $this->ownerRef($request), + $validated['assigned_member_id'] ?? null, + $this->ownerRef($request), + ); + + return redirect()->route('care.lab.requests.show', $investigation) + ->with('success', 'Processing started.'); + } + + public function enterResults(Request $request, InvestigationRequest $investigation): RedirectResponse + { + $this->authorizeAbility($request, 'lab.manage'); + $this->authorizeInvestigation($request, $investigation); + + $validated = $request->validate([ + 'value' => ['nullable', 'string', 'max:255'], + 'result_summary' => ['nullable', 'string', 'max:5000'], + 'interpretation' => ['nullable', 'string', 'max:5000'], + 'values' => ['nullable', 'array'], + 'values.*.parameter' => ['nullable', 'string', 'max:255'], + 'values.*.value' => ['nullable', 'string', 'max:255'], + 'attachments' => ['nullable', 'array'], + 'attachments.*' => ['file', 'max:10240', 'mimes:pdf,jpeg,png,jpg,webp'], + ]); + + $this->investigations->enterResults( + $investigation, + $this->ownerRef($request), + $validated, + $this->ownerRef($request), + ); + + return back()->with('success', 'Results submitted for review.'); + } + + public function approve(Request $request, InvestigationRequest $investigation): RedirectResponse + { + $this->authorizeAbility($request, 'lab.manage'); + $this->authorizeInvestigation($request, $investigation); + + $this->investigations->approve($investigation, $this->ownerRef($request), $this->ownerRef($request)); + + return back()->with('success', 'Results approved.'); + } + + public function deliver(Request $request, InvestigationRequest $investigation): RedirectResponse + { + $this->authorizeAbility($request, 'lab.manage'); + $this->authorizeInvestigation($request, $investigation); + + $this->investigations->deliver($investigation, $this->ownerRef($request), $this->ownerRef($request)); + + return back()->with('success', 'Results delivered to patient record.'); + } + + public function cancel(Request $request, InvestigationRequest $investigation): RedirectResponse + { + $this->authorizeAbility($request, 'lab.manage'); + $this->authorizeInvestigation($request, $investigation); + + $this->investigations->cancel($investigation, $this->ownerRef($request), $this->ownerRef($request)); + + return back()->with('success', 'Investigation cancelled.'); + } + + protected function authorizeConsultation(Request $request, Consultation $consultation): void + { + $this->authorizeOwner($request, $consultation); + $consultation->loadMissing('visit'); + abort_unless($consultation->visit->organization_id === $this->organization($request)->id, 404); + } + + protected function authorizeInvestigation(Request $request, InvestigationRequest $investigation): void + { + $this->authorizeOwner($request, $investigation); + abort_unless($investigation->organization_id === $this->organization($request)->id, 404); + + $branchId = app(OrganizationResolver::class)->branchScope($this->member($request)); + if ($branchId !== null && $investigation->branch_id !== $branchId) { + abort(404); + } + } +} diff --git a/app/Http/Controllers/Care/InvestigationTypeController.php b/app/Http/Controllers/Care/InvestigationTypeController.php new file mode 100644 index 0000000..bce2e24 --- /dev/null +++ b/app/Http/Controllers/Care/InvestigationTypeController.php @@ -0,0 +1,108 @@ +authorizeAbility($request, 'lab.manage'); + $organization = $this->organization($request); + + $types = InvestigationType::owned($this->ownerRef($request)) + ->where('organization_id', $organization->id) + ->orderBy('category') + ->orderBy('name') + ->paginate(30); + + return view('care.lab.catalog.index', [ + 'organization' => $organization, + 'types' => $types, + 'categories' => config('care.investigation_categories'), + ]); + } + + public function create(Request $request): View + { + $this->authorizeAbility($request, 'lab.manage'); + + return view('care.lab.catalog.create', [ + 'categories' => config('care.investigation_categories'), + ]); + } + + public function store(Request $request): RedirectResponse + { + $this->authorizeAbility($request, 'lab.manage'); + + $type = $this->investigations->createType( + $this->organization($request), + $this->ownerRef($request), + $this->validatedTypeData($request), + ); + + return redirect()->route('care.lab.catalog.index') + ->with('success', "Investigation type \"{$type->name}\" created."); + } + + public function edit(Request $request, InvestigationType $investigationType): View + { + $this->authorizeAbility($request, 'lab.manage'); + $this->authorizeType($request, $investigationType); + + return view('care.lab.catalog.edit', [ + 'type' => $investigationType, + 'categories' => config('care.investigation_categories'), + ]); + } + + public function update(Request $request, InvestigationType $investigationType): RedirectResponse + { + $this->authorizeAbility($request, 'lab.manage'); + $this->authorizeType($request, $investigationType); + + $this->investigations->updateType($investigationType, $this->ownerRef($request), $this->validatedTypeData($request)); + + return redirect()->route('care.lab.catalog.index') + ->with('success', 'Investigation type updated.'); + } + + protected function authorizeType(Request $request, InvestigationType $type): void + { + $this->authorizeOwner($request, $type); + abort_unless($type->organization_id === $this->organization($request)->id, 404); + } + + /** + * @return array + */ + protected function validatedTypeData(Request $request): array + { + return $request->validate([ + 'name' => ['required', 'string', 'max:255'], + 'code' => ['nullable', 'string', 'max:50'], + 'category' => ['required', 'string', 'in:'.implode(',', array_keys(config('care.investigation_categories')))], + 'description' => ['nullable', 'string', 'max:2000'], + 'unit' => ['nullable', 'string', 'max:50'], + 'reference_low' => ['nullable', 'numeric'], + 'reference_high' => ['nullable', 'numeric'], + 'reference_text' => ['nullable', 'string', 'max:255'], + 'price_minor' => ['nullable', 'integer', 'min:0'], + 'is_active' => ['nullable', 'boolean'], + ]); + } +} diff --git a/app/Http/Controllers/Care/MemberController.php b/app/Http/Controllers/Care/MemberController.php new file mode 100644 index 0000000..8cb28df --- /dev/null +++ b/app/Http/Controllers/Care/MemberController.php @@ -0,0 +1,98 @@ +authorizeAbility($request, 'admin.members.view'); + $organization = $this->organization($request); + + $members = Member::owned($this->ownerRef($request)) + ->where('organization_id', $organization->id) + ->with('branch') + ->orderBy('created_at') + ->get(); + + return view('care.admin.members.index', [ + 'members' => $members, + 'organization' => $organization, + 'roles' => config('care.roles'), + ]); + } + + public function create(Request $request): View + { + $this->authorizeAbility($request, 'admin.members.manage'); + $organization = $this->organization($request); + + $branches = Branch::owned($this->ownerRef($request)) + ->where('organization_id', $organization->id) + ->where('is_active', true) + ->orderBy('name') + ->get(); + + return view('care.admin.members.create', [ + 'organization' => $organization, + 'branches' => $branches, + 'roles' => config('care.roles'), + ]); + } + + public function store(Request $request): RedirectResponse + { + $this->authorizeAbility($request, 'admin.members.manage'); + $organization = $this->organization($request); + $owner = $this->ownerRef($request); + + $validated = $request->validate([ + 'user_ref' => ['required', 'string', 'max:255'], + 'role' => ['required', 'string', 'in:'.implode(',', array_keys(config('care.roles')))], + 'branch_id' => ['nullable', 'integer', 'exists:care_branches,id'], + ]); + + $member = Member::updateOrCreate( + [ + 'organization_id' => $organization->id, + 'user_ref' => $validated['user_ref'], + ], + [ + 'owner_ref' => $owner, + 'role' => $validated['role'], + 'branch_id' => $validated['branch_id'] ?? null, + ], + ); + + AuditLogger::record($owner, 'member.created', $organization->id, $owner, Member::class, $member->id); + + return redirect()->route('care.members.index')->with('success', 'Member saved.'); + } + + public function destroy(Request $request, Member $member): RedirectResponse + { + $this->authorizeAbility($request, 'admin.members.manage'); + $this->authorizeOwner($request, $member); + + abort_if($member->user_ref === $this->ownerRef($request), 422, 'You cannot remove yourself.'); + + $memberId = $member->id; + $organizationId = $member->organization_id; + $member->delete(); + + AuditLogger::record($this->ownerRef($request), 'member.deleted', $organizationId, $this->ownerRef($request), Member::class, $memberId); + + return redirect()->route('care.members.index')->with('success', 'Member removed.'); + } +} diff --git a/app/Http/Controllers/Care/OnboardingController.php b/app/Http/Controllers/Care/OnboardingController.php new file mode 100644 index 0000000..e87e542 --- /dev/null +++ b/app/Http/Controllers/Care/OnboardingController.php @@ -0,0 +1,65 @@ +organizations->isOnboarded($request->user())) { + return redirect()->route('care.dashboard'); + } + + return view('care.onboarding.show', [ + 'user' => $request->user(), + 'timezones' => timezone_identifiers_list(), + 'facilityTypes' => [ + 'clinic' => 'Clinic', + 'hospital' => 'Hospital', + 'diagnostic' => 'Diagnostic laboratory', + 'specialist' => 'Specialist practice', + ], + ]); + } + + public function store(Request $request): RedirectResponse + { + if ($this->organizations->isOnboarded($request->user())) { + return redirect()->route('care.dashboard'); + } + + $validated = $request->validate([ + 'organization_name' => ['required', 'string', 'max:255'], + 'facility_type' => ['required', 'string', 'in:clinic,hospital,diagnostic,specialist'], + 'branch_name' => ['required', 'string', 'max:255'], + 'branch_address' => ['nullable', 'string', 'max:500'], + 'branch_phone' => ['nullable', 'string', 'max:50'], + 'timezone' => ['required', 'timezone'], + 'logo' => ['nullable', 'image', 'mimes:jpeg,png,jpg,webp,svg', 'max:2048'], + ]); + + $organization = $this->organizations->completeOnboarding($request->user(), $validated); + + if ($request->hasFile('logo')) { + $organization->update([ + 'logo_path' => OrganizationBranding::storeLogo($organization, $request->file('logo')), + ]); + } + + return redirect()->route('care.dashboard')->with('success', 'Welcome to Ladill Care!'); + } +} diff --git a/app/Http/Controllers/Care/PatientController.php b/app/Http/Controllers/Care/PatientController.php new file mode 100644 index 0000000..e85ff40 --- /dev/null +++ b/app/Http/Controllers/Care/PatientController.php @@ -0,0 +1,200 @@ +authorizeAbility($request, 'patients.view'); + $organization = $this->organization($request); + $branchScope = app(OrganizationResolver::class)->branchScope($this->member($request)); + + $patients = $this->patients->search( + $this->ownerRef($request), + $organization->id, + $request->only(['q', 'patient_number', 'phone', 'national_id', 'date_of_birth']), + $branchScope, + ); + + return view('care.patients.index', compact('patients', 'organization')); + } + + public function create(Request $request): View + { + $this->authorizeAbility($request, 'patients.manage'); + $organization = $this->organization($request); + + $branches = Branch::owned($this->ownerRef($request)) + ->where('organization_id', $organization->id) + ->where('is_active', true) + ->orderBy('name') + ->get(); + + return view('care.patients.create', [ + 'organization' => $organization, + 'branches' => $branches, + 'genders' => config('care.genders'), + 'allergySeverities' => config('care.allergy_severities'), + 'documentTypes' => config('care.document_types'), + ]); + } + + public function store(Request $request): RedirectResponse + { + $this->authorizeAbility($request, 'patients.manage'); + $organization = $this->organization($request); + + $validated = $this->validatedPatientData($request); + + $patient = $this->patients->create( + $organization, + $this->ownerRef($request), + $validated, + $this->ownerRef($request), + ); + + return redirect()->route('care.patients.show', $patient) + ->with('success', 'Patient registered successfully.'); + } + + public function show(Request $request, Patient $patient): View + { + $this->authorizeAbility($request, 'patients.view'); + $this->authorizePatient($request, $patient); + + $dashboard = $this->patients->dashboard($patient); + $canManage = app(\App\Services\Care\CarePermissions::class) + ->can($this->member($request), 'patients.manage'); + + return view('care.patients.show', array_merge($dashboard, [ + 'canManage' => $canManage, + 'genders' => config('care.genders'), + 'allergySeverities' => config('care.allergy_severities'), + 'documentTypes' => config('care.document_types'), + ])); + } + + public function edit(Request $request, Patient $patient): View + { + $this->authorizeAbility($request, 'patients.manage'); + $this->authorizePatient($request, $patient); + $organization = $this->organization($request); + + $patient->load(['allergies', 'conditions', 'familyHistory', 'emergencyContacts', 'insurancePolicies', 'attachments']); + + $branches = Branch::owned($this->ownerRef($request)) + ->where('organization_id', $organization->id) + ->where('is_active', true) + ->orderBy('name') + ->get(); + + return view('care.patients.edit', [ + 'patient' => $patient, + 'organization' => $organization, + 'branches' => $branches, + 'genders' => config('care.genders'), + 'allergySeverities' => config('care.allergy_severities'), + 'documentTypes' => config('care.document_types'), + ]); + } + + public function update(Request $request, Patient $patient): RedirectResponse + { + $this->authorizeAbility($request, 'patients.manage'); + $this->authorizePatient($request, $patient); + + $validated = $this->validatedPatientData($request); + + $this->patients->update($patient, $this->ownerRef($request), $validated, $this->ownerRef($request)); + + return redirect()->route('care.patients.show', $patient) + ->with('success', 'Patient record updated.'); + } + + public function destroy(Request $request, Patient $patient): RedirectResponse + { + $this->authorizeAbility($request, 'patients.manage'); + $this->authorizePatient($request, $patient); + + $this->patients->delete($patient, $this->ownerRef($request), $this->ownerRef($request)); + + return redirect()->route('care.patients.index') + ->with('success', 'Patient record archived.'); + } + + protected function authorizePatient(Request $request, Patient $patient): void + { + $this->authorizeOwner($request, $patient); + abort_unless($patient->organization_id === $this->organization($request)->id, 404); + + $branchId = app(OrganizationResolver::class)->branchScope($this->member($request)); + if ($branchId !== null && $patient->branch_id !== $branchId) { + abort(404); + } + } + + /** + * @return array + */ + protected function validatedPatientData(Request $request): array + { + return $request->validate([ + 'branch_id' => ['nullable', 'integer', 'exists:care_branches,id'], + 'first_name' => ['required', 'string', 'max:100'], + 'last_name' => ['required', 'string', 'max:100'], + 'other_names' => ['nullable', 'string', 'max:100'], + 'gender' => ['nullable', 'string', 'in:'.implode(',', array_keys(config('care.genders')))], + 'date_of_birth' => ['nullable', 'date', 'before:today'], + 'phone' => ['nullable', 'string', 'max:30'], + 'email' => ['nullable', 'email', 'max:255'], + 'national_id' => ['nullable', 'string', 'max:50'], + 'address' => ['nullable', 'string', 'max:500'], + 'city' => ['nullable', 'string', 'max:100'], + 'region' => ['nullable', 'string', 'max:100'], + 'notes' => ['nullable', 'string', 'max:5000'], + 'allergies' => ['nullable', 'array'], + 'allergies.*.allergen' => ['nullable', 'string', 'max:255'], + 'allergies.*.severity' => ['nullable', 'string', 'in:'.implode(',', array_keys(config('care.allergy_severities')))], + 'allergies.*.notes' => ['nullable', 'string', 'max:1000'], + 'conditions' => ['nullable', 'array'], + 'conditions.*.condition' => ['nullable', 'string', 'max:255'], + 'conditions.*.onset_date' => ['nullable', 'date'], + 'conditions.*.is_chronic' => ['nullable', 'boolean'], + 'conditions.*.notes' => ['nullable', 'string', 'max:1000'], + 'family_history' => ['nullable', 'array'], + 'family_history.*.relation' => ['nullable', 'string', 'max:100'], + 'family_history.*.condition' => ['nullable', 'string', 'max:255'], + 'family_history.*.notes' => ['nullable', 'string', 'max:1000'], + 'emergency_contacts' => ['nullable', 'array'], + 'emergency_contacts.*.name' => ['nullable', 'string', 'max:255'], + 'emergency_contacts.*.phone' => ['nullable', 'string', 'max:30'], + 'emergency_contacts.*.relationship' => ['nullable', 'string', 'max:100'], + 'emergency_contacts.*.is_primary' => ['nullable', 'boolean'], + 'insurance' => ['nullable', 'array'], + 'insurance.*.provider_name' => ['nullable', 'string', 'max:255'], + 'insurance.*.policy_number' => ['nullable', 'string', 'max:100'], + 'insurance.*.coverage_type' => ['nullable', 'string', 'max:100'], + 'insurance.*.expiry_date' => ['nullable', 'date'], + 'insurance.*.notes' => ['nullable', 'string', 'max:1000'], + 'attachments' => ['nullable', 'array'], + 'attachments.*' => ['file', 'max:10240', 'mimes:pdf,jpeg,png,jpg,webp'], + ]); + } +} diff --git a/app/Http/Controllers/Care/PrescriptionController.php b/app/Http/Controllers/Care/PrescriptionController.php new file mode 100644 index 0000000..e0e0c65 --- /dev/null +++ b/app/Http/Controllers/Care/PrescriptionController.php @@ -0,0 +1,209 @@ +authorizeAbility($request, 'prescriptions.view'); + $organization = $this->organization($request); + $branchScope = app(OrganizationResolver::class)->branchScope($this->member($request)); + + $prescriptions = $this->prescriptions->list( + $this->ownerRef($request), + $organization->id, + $request->only(['status', 'patient_id']), + $branchScope, + ); + + return view('care.prescriptions.index', [ + 'organization' => $organization, + 'prescriptions' => $prescriptions, + 'statuses' => config('care.prescription_statuses'), + ]); + } + + public function queue(Request $request): View + { + $this->authorizeAbility($request, 'prescriptions.view'); + $organization = $this->organization($request); + + $queue = $this->prescriptions->pharmacyQueue($this->ownerRef($request), $organization->id); + + $drugs = \App\Models\Drug::owned($this->ownerRef($request)) + ->where('organization_id', $organization->id) + ->where('is_active', true) + ->with(['batches' => fn ($q) => $q->where('quantity_on_hand', '>', 0)->orderBy('expiry_date')]) + ->orderBy('name') + ->get(); + + $canDispense = app(\App\Services\Care\CarePermissions::class) + ->can($this->member($request), 'prescriptions.dispense'); + + return view('care.prescriptions.queue', [ + 'organization' => $organization, + 'queue' => $queue, + 'drugs' => $drugs, + 'canDispense' => $canDispense, + ]); + } + + public function create(Request $request, Consultation $consultation): View + { + $this->authorizeAbility($request, 'prescriptions.manage'); + $this->authorizeConsultation($request, $consultation); + + $consultation->load(['patient', 'practitioner']); + + $practitioners = Practitioner::owned($this->ownerRef($request)) + ->where('organization_id', $this->organization($request)->id) + ->where('is_active', true) + ->orderBy('name') + ->get(); + + return view('care.prescriptions.create', [ + 'consultation' => $consultation, + 'practitioners' => $practitioners, + 'routes' => config('care.medication_routes'), + ]); + } + + public function store(Request $request, Consultation $consultation): RedirectResponse + { + $this->authorizeAbility($request, 'prescriptions.manage'); + $this->authorizeConsultation($request, $consultation); + + $prescription = $this->prescriptions->createFromConsultation( + $consultation, + $this->ownerRef($request), + $this->validatedPrescriptionData($request), + $this->ownerRef($request), + ); + + return redirect()->route('care.prescriptions.show', $prescription) + ->with('success', 'Prescription created.'); + } + + public function show(Request $request, Prescription $prescription): View + { + $this->authorizeAbility($request, 'prescriptions.view'); + $this->authorizePrescription($request, $prescription); + + $prescription->load(['patient', 'practitioner', 'items', 'consultation', 'visit']); + + $canManage = app(\App\Services\Care\CarePermissions::class) + ->can($this->member($request), 'prescriptions.manage'); + $canDispense = app(\App\Services\Care\CarePermissions::class) + ->can($this->member($request), 'prescriptions.dispense'); + + return view('care.prescriptions.show', [ + 'prescription' => $prescription, + 'statuses' => config('care.prescription_statuses'), + 'routes' => config('care.medication_routes'), + 'canManage' => $canManage, + 'canDispense' => $canDispense, + ]); + } + + public function activate(Request $request, Prescription $prescription): RedirectResponse + { + $this->authorizeAbility($request, 'prescriptions.manage'); + $this->authorizePrescription($request, $prescription); + + $this->prescriptions->activate($prescription, $this->ownerRef($request), $this->ownerRef($request)); + + return back()->with('success', 'Prescription activated.'); + } + + public function dispense(Request $request, Prescription $prescription): RedirectResponse + { + $this->authorizeAbility($request, 'prescriptions.dispense'); + $this->authorizePrescription($request, $prescription); + + $allocations = $request->input('allocations', []); + + if (! empty($allocations)) { + $this->pharmacy->dispensePrescription( + $prescription, + $this->ownerRef($request), + $allocations, + $this->ownerRef($request), + ); + } else { + $this->prescriptions->dispense($prescription, $this->ownerRef($request), $this->ownerRef($request)); + } + + return redirect()->route('care.prescriptions.queue') + ->with('success', 'Prescription dispensed.'); + } + + public function cancel(Request $request, Prescription $prescription): RedirectResponse + { + $this->authorizeAbility($request, 'prescriptions.manage'); + $this->authorizePrescription($request, $prescription); + + $this->prescriptions->cancel($prescription, $this->ownerRef($request), $this->ownerRef($request)); + + return back()->with('success', 'Prescription cancelled.'); + } + + protected function authorizeConsultation(Request $request, Consultation $consultation): void + { + $this->authorizeOwner($request, $consultation); + $consultation->loadMissing('visit'); + abort_unless($consultation->visit->organization_id === $this->organization($request)->id, 404); + } + + protected function authorizePrescription(Request $request, Prescription $prescription): void + { + $this->authorizeOwner($request, $prescription); + abort_unless($prescription->organization_id === $this->organization($request)->id, 404); + + $branchId = app(OrganizationResolver::class)->branchScope($this->member($request)); + if ($branchId !== null) { + $prescription->loadMissing('visit'); + abort_unless($prescription->visit->branch_id === $branchId, 404); + } + } + + /** + * @return array + */ + protected function validatedPrescriptionData(Request $request): array + { + return $request->validate([ + 'practitioner_id' => ['nullable', 'integer', 'exists:care_practitioners,id'], + 'notes' => ['nullable', 'string', 'max:5000'], + 'activate' => ['nullable', 'boolean'], + 'items' => ['required', 'array', 'min:1'], + 'items.*.is_procedure' => ['nullable', 'boolean'], + 'items.*.name' => ['required', 'string', 'max:255'], + 'items.*.dosage' => ['nullable', 'string', 'max:100'], + 'items.*.frequency' => ['nullable', 'string', 'max:100'], + 'items.*.duration' => ['nullable', 'string', 'max:100'], + 'items.*.route' => ['nullable', 'string', 'max:50'], + 'items.*.quantity' => ['nullable', 'string', 'max:50'], + 'items.*.instructions' => ['nullable', 'string', 'max:2000'], + ]); + } +} diff --git a/app/Http/Controllers/Care/QueueController.php b/app/Http/Controllers/Care/QueueController.php new file mode 100644 index 0000000..4f55bb6 --- /dev/null +++ b/app/Http/Controllers/Care/QueueController.php @@ -0,0 +1,113 @@ +authorizeAbility($request, 'appointments.view'); + $organization = $this->organization($request); + $branchScope = app(OrganizationResolver::class)->branchScope($this->member($request)); + + $branches = Branch::owned($this->ownerRef($request)) + ->where('organization_id', $organization->id) + ->where('is_active', true) + ->when($branchScope, fn ($q) => $q->where('id', $branchScope)) + ->orderBy('name') + ->get(); + + $branchId = (int) ($request->input('branch_id') ?: $branchScope ?: $branches->first()?->id); + $practitionerId = $request->input('practitioner_id') ? (int) $request->input('practitioner_id') : null; + + $queue = $branchId + ? $this->appointments->queue($this->ownerRef($request), $branchId, $practitionerId) + : collect(); + + $inConsultation = Appointment::owned($this->ownerRef($request)) + ->where('organization_id', $organization->id) + ->where('status', Appointment::STATUS_IN_CONSULTATION) + ->when($branchId, fn ($q) => $q->where('branch_id', $branchId)) + ->when($practitionerId, fn ($q) => $q->where('practitioner_id', $practitionerId)) + ->with(['patient', 'practitioner', 'consultation']) + ->orderBy('started_at') + ->get(); + + $canManageQueue = app(\App\Services\Care\CarePermissions::class) + ->can($this->member($request), 'queue.manage'); + $canConsult = app(\App\Services\Care\CarePermissions::class) + ->can($this->member($request), 'consultations.manage'); + + return view('care.queue.index', [ + 'organization' => $organization, + 'branches' => $branches, + 'branchId' => $branchId, + 'practitioners' => Practitioner::owned($this->ownerRef($request)) + ->where('organization_id', $organization->id) + ->where('is_active', true) + ->orderBy('name') + ->get(), + 'practitionerId' => $practitionerId, + 'queue' => $queue, + 'inConsultation' => $inConsultation, + 'canManageQueue' => $canManageQueue, + 'canConsult' => $canConsult, + ]); + } + + public function start(Request $request, Appointment $appointment): RedirectResponse + { + $this->authorizeAbility($request, 'consultations.manage'); + $this->authorizeAppointment($request, $appointment); + + $practitionerId = $request->input('practitioner_id') + ? (int) $request->input('practitioner_id') + : $appointment->practitioner_id; + + $this->appointments->startConsultation( + $appointment, + $this->ownerRef($request), + $practitionerId, + $this->ownerRef($request), + ); + + $consultation = $this->consultations->startFromAppointment( + $appointment->fresh(), + $this->ownerRef($request), + $this->ownerRef($request), + ); + + return redirect()->route('care.consultations.show', $consultation) + ->with('success', 'Consultation started.'); + } + + protected function authorizeAppointment(Request $request, Appointment $appointment): void + { + $this->authorizeOwner($request, $appointment); + abort_unless($appointment->organization_id === $this->organization($request)->id, 404); + + $branchId = app(OrganizationResolver::class)->branchScope($this->member($request)); + if ($branchId !== null && $appointment->branch_id !== $branchId) { + abort(404); + } + } +} diff --git a/app/Http/Controllers/Care/ReportController.php b/app/Http/Controllers/Care/ReportController.php new file mode 100644 index 0000000..ed06fe4 --- /dev/null +++ b/app/Http/Controllers/Care/ReportController.php @@ -0,0 +1,134 @@ +authorizeAbility($request, 'reports.finance.view'); + $organization = $this->organization($request); + + $branches = Branch::owned($this->ownerRef($request)) + ->where('organization_id', $organization->id) + ->where('is_active', true) + ->orderBy('name') + ->get(); + + return view('care.reports.index', [ + 'organization' => $organization, + 'branches' => $branches, + 'reports' => config('care.report_types'), + ]); + } + + public function show(Request $request, string $type): View + { + $this->authorizeReport($request, $type); + $organization = $this->organization($request); + $branchScope = app(OrganizationResolver::class)->branchScope($this->member($request)); + $branchId = $request->input('branch_id') ? (int) $request->input('branch_id') : $branchScope; + + [$from, $to] = $this->dateRange($request); + + $data = match ($type) { + 'patients' => $this->reports->patientsReport($this->ownerRef($request), $organization->id, $from, $to, $branchId), + 'appointments' => $this->reports->appointmentsReport($this->ownerRef($request), $organization->id, $from, $to, $branchId), + 'laboratory' => $this->reports->laboratoryReport($this->ownerRef($request), $organization->id, $from, $to, $branchId), + 'finance' => $this->reports->financeReport($this->ownerRef($request), $organization->id, $from, $to, $branchId), + 'clinical' => ['diagnoses' => $this->reports->clinicalReport($this->ownerRef($request), $organization->id, $from, $to)], + default => abort(404), + }; + + $branches = Branch::owned($this->ownerRef($request)) + ->where('organization_id', $organization->id) + ->orderBy('name') + ->get(); + + return view('care.reports.show', [ + 'type' => $type, + 'label' => config('care.report_types')[$type] ?? $type, + 'data' => $data, + 'from' => $from->toDateString(), + 'to' => $to->toDateString(), + 'branchId' => $branchId, + 'branches' => $branches, + 'canExport' => app(\App\Services\Care\CarePermissions::class) + ->can($this->member($request), 'reports.finance.export'), + ]); + } + + public function export(Request $request, string $type): StreamedResponse + { + $this->authorizeReport($request, $type); + abort_unless( + app(\App\Services\Care\CarePermissions::class)->can($this->member($request), 'reports.finance.export'), + 403, + ); + + $organization = $this->organization($request); + $branchScope = app(OrganizationResolver::class)->branchScope($this->member($request)); + $branchId = $request->input('branch_id') ? (int) $request->input('branch_id') : $branchScope; + [$from, $to] = $this->dateRange($request); + + $data = match ($type) { + 'patients' => $this->reports->patientsReport($this->ownerRef($request), $organization->id, $from, $to, $branchId), + 'appointments' => $this->reports->appointmentsReport($this->ownerRef($request), $organization->id, $from, $to, $branchId), + 'laboratory' => $this->reports->laboratoryReport($this->ownerRef($request), $organization->id, $from, $to, $branchId), + 'finance' => $this->reports->financeReport($this->ownerRef($request), $organization->id, $from, $to, $branchId), + 'clinical' => ['diagnoses' => $this->reports->clinicalReport($this->ownerRef($request), $organization->id, $from, $to)], + default => abort(404), + }; + + $filename = "care-report-{$type}-".now()->format('Y-m-d').'.csv'; + + return response()->streamDownload(function () use ($data, $type) { + $handle = fopen('php://output', 'w'); + if ($type === 'clinical' && isset($data['diagnoses'])) { + fputcsv($handle, ['Diagnosis', 'Count']); + foreach ($data['diagnoses'] as $row) { + fputcsv($handle, [$row->description, $row->total]); + } + } else { + fputcsv($handle, ['Metric', 'Value']); + foreach ($data as $key => $value) { + fputcsv($handle, [$key, is_scalar($value) ? $value : json_encode($value)]); + } + } + fclose($handle); + }, $filename, ['Content-Type' => 'text/csv']); + } + + protected function authorizeReport(Request $request, string $type): void + { + abort_unless(array_key_exists($type, config('care.report_types')), 404); + $this->authorizeAbility($request, 'reports.finance.view'); + } + + /** + * @return array{0: Carbon, 1: Carbon} + */ + protected function dateRange(Request $request): array + { + $from = Carbon::parse($request->input('from', now()->subDays(30)->toDateString()))->startOfDay(); + $to = Carbon::parse($request->input('to', now()->toDateString()))->endOfDay(); + + return [$from, $to]; + } +} diff --git a/app/Http/Controllers/Care/SettingsController.php b/app/Http/Controllers/Care/SettingsController.php new file mode 100644 index 0000000..7c232c7 --- /dev/null +++ b/app/Http/Controllers/Care/SettingsController.php @@ -0,0 +1,82 @@ +authorizeAbility($request, 'settings.view'); + $organization = $this->organization($request); + $canManage = app(CarePermissions::class)->can($this->member($request), 'settings.manage'); + + $branchCount = Branch::owned($this->ownerRef($request)) + ->where('organization_id', $organization->id) + ->count(); + + return view('care.settings.edit', [ + 'organization' => $organization, + 'canManage' => $canManage, + 'branchCount' => $branchCount, + 'facilityTypes' => [ + 'clinic' => 'Clinic', + 'hospital' => 'Hospital', + 'diagnostic' => 'Diagnostic laboratory', + 'specialist' => 'Specialist practice', + ], + ]); + } + + public function update(Request $request): RedirectResponse + { + $this->authorizeAbility($request, 'settings.manage'); + $organization = $this->organization($request); + $owner = $this->ownerRef($request); + + $validated = $request->validate([ + 'name' => ['required', 'string', 'max:255'], + 'timezone' => ['required', 'timezone'], + 'facility_type' => ['required', 'string', 'in:clinic,hospital,diagnostic,specialist'], + 'logo' => ['nullable', 'image', 'mimes:jpeg,png,jpg,webp,svg', 'max:2048'], + 'remove_logo' => ['nullable', 'boolean'], + ]); + + $settings = $organization->settings ?? []; + $settings['onboarded'] = true; + $settings['facility_type'] = $validated['facility_type']; + + $logoPath = $organization->logo_path; + + if ($request->boolean('remove_logo')) { + OrganizationBranding::deleteStoredLogo($organization); + $logoPath = null; + } + + if ($request->hasFile('logo')) { + $logoPath = OrganizationBranding::storeLogo($organization, $request->file('logo')); + } + + $organization->update([ + 'name' => $validated['name'], + 'timezone' => $validated['timezone'], + 'logo_path' => $logoPath, + 'settings' => $settings, + ]); + + AuditLogger::record($owner, 'organization.updated', $organization->id, $owner, \App\Models\Organization::class, $organization->id); + + return back()->with('success', 'Settings saved.'); + } +} diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.php new file mode 100644 index 0000000..e7f7c94 --- /dev/null +++ b/app/Http/Controllers/Controller.php @@ -0,0 +1,10 @@ +bearerToken(); + $caller = null; + + if ($token !== '') { + foreach ((array) config("{$namespace}.service_api_keys", []) as $name => $key) { + if (is_string($key) && $key !== '' && hash_equals($key, $token)) { + $caller = $name; + break; + } + } + } + + if ($caller === null) { + return response()->json(['error' => 'Unauthorized.'], 401); + } + + $request->attributes->set('service_caller', $caller); + + return $next($request); + } +} diff --git a/app/Http/Middleware/EnsureCareAbility.php b/app/Http/Middleware/EnsureCareAbility.php new file mode 100644 index 0000000..d8c102c --- /dev/null +++ b/app/Http/Middleware/EnsureCareAbility.php @@ -0,0 +1,34 @@ +user(); + abort_unless($user, 403); + + $organization = $this->organizations->resolveForUser($user); + abort_unless($organization, 403); + + $member = $this->organizations->memberFor($user, $organization); + abort_unless($this->permissions->can($member, $ability), 403); + + $request->attributes->set('care.organization', $organization); + $request->attributes->set('care.member', $member); + + return $next($request); + } +} diff --git a/app/Http/Middleware/EnsureOrganizationSetup.php b/app/Http/Middleware/EnsureOrganizationSetup.php new file mode 100644 index 0000000..7ede739 --- /dev/null +++ b/app/Http/Middleware/EnsureOrganizationSetup.php @@ -0,0 +1,33 @@ +user(); + if (! $user) { + return $next($request); + } + + if ($request->routeIs('care.onboarding*')) { + return $next($request); + } + + if (! $this->organizations->isOnboarded($user)) { + return redirect()->route('care.onboarding.show'); + } + + return $next($request); + } +} diff --git a/app/Http/Middleware/EnsurePlatformSession.php b/app/Http/Middleware/EnsurePlatformSession.php new file mode 100644 index 0000000..db642f5 --- /dev/null +++ b/app/Http/Middleware/EnsurePlatformSession.php @@ -0,0 +1,58 @@ +headers->get('Cookie', ''); + if ($cookieHeader === '') { + return $this->clearAppSession($request); + } + + try { + $response = Http::withHeaders(['Cookie' => $cookieHeader]) + ->timeout(3) + ->get('https://'.$authDomain.'/sso/ping'); + } catch (\Throwable) { + return $next($request); + } + + if ($response->status() === 401) { + return $this->clearAppSession($request); + } + + return $next($request); + } + + private function clearAppSession(Request $request): Response + { + Auth::logout(); + $request->session()->invalidate(); + $request->session()->regenerateToken(); + + return redirect()->route('sso.connect', [ + 'redirect' => $request->fullUrl(), + ]); + } +} diff --git a/app/Http/Middleware/SetActingAccount.php b/app/Http/Middleware/SetActingAccount.php new file mode 100644 index 0000000..7e1d5c0 --- /dev/null +++ b/app/Http/Middleware/SetActingAccount.php @@ -0,0 +1,29 @@ +user()) { + $request->attributes->set('actingAccount', $user); + + if (! $request->is('api/*')) { + View::share('actingAccount', $user); + } + } + + return $next($request); + } +} diff --git a/app/Listeners/PlatformServiceEventListener.php b/app/Listeners/PlatformServiceEventListener.php new file mode 100644 index 0000000..b4d55a3 --- /dev/null +++ b/app/Listeners/PlatformServiceEventListener.php @@ -0,0 +1,85 @@ +name) { + 'user.deleted' => $this->handleUserDeleted($event), + 'user.suspended' => $this->handleUserSuspended($event), + 'organization.updated' => $this->handleOrganizationUpdated($event), + default => null, + }; + } + + protected function handleUserDeleted(ServiceEventOccurred $event): void + { + $publicId = (string) ($event->data['user'] ?? ''); + if ($publicId === '') { + return; + } + + DB::transaction(function () use ($publicId) { + Member::where('user_ref', $publicId)->delete(); + User::where('public_id', $publicId)->delete(); + }); + + Log::info('PlatformServiceEventListener: user deleted', ['public_id' => $publicId]); + } + + protected function handleUserSuspended(ServiceEventOccurred $event): void + { + $publicId = (string) ($event->data['user'] ?? ''); + if ($publicId === '') { + return; + } + + $user = User::where('public_id', $publicId)->first(); + if ($user) { + $user->tokens()->delete(); + } + + Log::info('PlatformServiceEventListener: user suspended', ['public_id' => $publicId]); + } + + protected function handleOrganizationUpdated(ServiceEventOccurred $event): void + { + $ownerRef = (string) ($event->data['owner'] ?? $event->data['user'] ?? ''); + if ($ownerRef === '') { + return; + } + + $organization = Organization::owned($ownerRef)->first(); + if (! $organization) { + return; + } + + $updates = array_filter([ + 'name' => $event->data['name'] ?? null, + 'timezone' => $event->data['timezone'] ?? null, + ], fn ($value) => $value !== null && $value !== ''); + + if ($updates === []) { + return; + } + + $organization->update($updates); + + Log::info('PlatformServiceEventListener: organization updated', [ + 'organization_id' => $organization->id, + 'owner_ref' => $ownerRef, + ]); + } +} diff --git a/app/Mail/ContactMessageMail.php b/app/Mail/ContactMessageMail.php new file mode 100644 index 0000000..8081ad8 --- /dev/null +++ b/app/Mail/ContactMessageMail.php @@ -0,0 +1,40 @@ +subjectLine, + replyTo: $this->replyToAddress ? [$this->replyToAddress] : [], + ); + } + + public function content(): Content + { + return new Content( + view: 'email.contact-message', + with: [ + 'bodyText' => $this->bodyText, + 'fromName' => $this->fromName, + ], + ); + } +} diff --git a/app/Models/Appointment.php b/app/Models/Appointment.php new file mode 100644 index 0000000..bdbf9d7 --- /dev/null +++ b/app/Models/Appointment.php @@ -0,0 +1,114 @@ + 'datetime', + 'checked_in_at' => 'datetime', + 'waiting_at' => 'datetime', + 'started_at' => 'datetime', + 'completed_at' => 'datetime', + 'cancelled_at' => 'datetime', + ]; + } + + protected static function booted(): void + { + static::creating(function (Appointment $appointment) { + if (! $appointment->uuid) { + $appointment->uuid = (string) Str::uuid(); + } + }); + } + + public function getRouteKeyName(): string + { + return 'uuid'; + } + + public function patient(): BelongsTo + { + return $this->belongsTo(Patient::class, 'patient_id'); + } + + public function practitioner(): BelongsTo + { + return $this->belongsTo(Practitioner::class, 'practitioner_id'); + } + + public function branch(): BelongsTo + { + return $this->belongsTo(Branch::class, 'branch_id'); + } + + public function department(): BelongsTo + { + return $this->belongsTo(Department::class, 'department_id'); + } + + public function organization(): BelongsTo + { + return $this->belongsTo(Organization::class, 'organization_id'); + } + + public function visit(): BelongsTo + { + return $this->belongsTo(Visit::class, 'visit_id'); + } + + public function consultation(): HasOne + { + return $this->hasOne(Consultation::class, 'appointment_id'); + } + + /** @return list */ + public static function activeStatuses(): array + { + return [ + self::STATUS_SCHEDULED, + self::STATUS_CHECKED_IN, + self::STATUS_WAITING, + self::STATUS_IN_CONSULTATION, + ]; + } +} diff --git a/app/Models/AuditLog.php b/app/Models/AuditLog.php new file mode 100644 index 0000000..f8fb180 --- /dev/null +++ b/app/Models/AuditLog.php @@ -0,0 +1,56 @@ + 'array', + 'created_at' => 'datetime', + ]; + } + + public function organization(): BelongsTo + { + return $this->belongsTo(Organization::class, 'organization_id'); + } + + public static function record( + string $ownerRef, + string $action, + ?int $organizationId = null, + ?string $actorRef = null, + ?string $subjectType = null, + ?int $subjectId = null, + ?array $metadata = null, + ): self { + return static::create([ + 'owner_ref' => $ownerRef, + 'organization_id' => $organizationId, + 'actor_ref' => $actorRef, + 'action' => $action, + 'subject_type' => $subjectType, + 'subject_id' => $subjectId, + 'metadata' => $metadata, + 'ip_address' => request()?->ip(), + 'created_at' => now(), + ]); + } +} diff --git a/app/Models/Bill.php b/app/Models/Bill.php new file mode 100644 index 0000000..3bbf161 --- /dev/null +++ b/app/Models/Bill.php @@ -0,0 +1,82 @@ + 'datetime']; + } + + protected static function booted(): void + { + static::creating(function (Bill $bill) { + if (! $bill->uuid) { + $bill->uuid = (string) Str::uuid(); + } + }); + } + + public function getRouteKeyName(): string + { + return 'uuid'; + } + + public function patient(): BelongsTo + { + return $this->belongsTo(Patient::class, 'patient_id'); + } + + public function visit(): BelongsTo + { + return $this->belongsTo(Visit::class, 'visit_id'); + } + + public function branch(): BelongsTo + { + return $this->belongsTo(Branch::class, 'branch_id'); + } + + public function organization(): BelongsTo + { + return $this->belongsTo(Organization::class, 'organization_id'); + } + + public function lineItems(): HasMany + { + return $this->hasMany(BillLineItem::class, 'bill_id'); + } + + public function payments(): HasMany + { + return $this->hasMany(Payment::class, 'bill_id'); + } +} diff --git a/app/Models/BillLineItem.php b/app/Models/BillLineItem.php new file mode 100644 index 0000000..33592cf --- /dev/null +++ b/app/Models/BillLineItem.php @@ -0,0 +1,24 @@ +belongsTo(Bill::class, 'bill_id'); + } +} diff --git a/app/Models/Branch.php b/app/Models/Branch.php new file mode 100644 index 0000000..4dbad98 --- /dev/null +++ b/app/Models/Branch.php @@ -0,0 +1,35 @@ + 'boolean']; + } + + public function organization(): BelongsTo + { + return $this->belongsTo(Organization::class, 'organization_id'); + } + + public function departments(): HasMany + { + return $this->hasMany(Department::class, 'branch_id'); + } +} diff --git a/app/Models/Concerns/BelongsToOwner.php b/app/Models/Concerns/BelongsToOwner.php new file mode 100644 index 0000000..4d95386 --- /dev/null +++ b/app/Models/Concerns/BelongsToOwner.php @@ -0,0 +1,13 @@ +where($this->getTable().'.owner_ref', $ownerRef); + } +} diff --git a/app/Models/Consultation.php b/app/Models/Consultation.php new file mode 100644 index 0000000..b31e7a0 --- /dev/null +++ b/app/Models/Consultation.php @@ -0,0 +1,95 @@ + 'datetime', + 'completed_at' => 'datetime', + ]; + } + + protected static function booted(): void + { + static::creating(function (Consultation $consultation) { + if (! $consultation->uuid) { + $consultation->uuid = (string) Str::uuid(); + } + }); + } + + public function getRouteKeyName(): string + { + return 'uuid'; + } + + public function visit(): BelongsTo + { + return $this->belongsTo(Visit::class, 'visit_id'); + } + + public function appointment(): BelongsTo + { + return $this->belongsTo(Appointment::class, 'appointment_id'); + } + + public function patient(): BelongsTo + { + return $this->belongsTo(Patient::class, 'patient_id'); + } + + public function practitioner(): BelongsTo + { + return $this->belongsTo(Practitioner::class, 'practitioner_id'); + } + + public function vitalSigns(): HasMany + { + return $this->hasMany(VitalSign::class, 'consultation_id'); + } + + public function diagnoses(): HasMany + { + return $this->hasMany(Diagnosis::class, 'consultation_id'); + } + + public function documents(): HasMany + { + return $this->hasMany(ConsultationDocument::class, 'consultation_id'); + } + + public function investigationRequests(): HasMany + { + return $this->hasMany(InvestigationRequest::class, 'consultation_id'); + } + + public function prescriptions(): HasMany + { + return $this->hasMany(Prescription::class, 'consultation_id'); + } +} diff --git a/app/Models/ConsultationDocument.php b/app/Models/ConsultationDocument.php new file mode 100644 index 0000000..134c8fc --- /dev/null +++ b/app/Models/ConsultationDocument.php @@ -0,0 +1,32 @@ +belongsTo(Consultation::class, 'consultation_id'); + } + + public function url(): ?string + { + return $this->file_path && Storage::disk('public')->exists($this->file_path) + ? Storage::disk('public')->url($this->file_path) + : null; + } +} diff --git a/app/Models/Department.php b/app/Models/Department.php new file mode 100644 index 0000000..45439af --- /dev/null +++ b/app/Models/Department.php @@ -0,0 +1,29 @@ + 'boolean']; + } + + public function branch(): BelongsTo + { + return $this->belongsTo(Branch::class, 'branch_id'); + } +} diff --git a/app/Models/Diagnosis.php b/app/Models/Diagnosis.php new file mode 100644 index 0000000..fab6b43 --- /dev/null +++ b/app/Models/Diagnosis.php @@ -0,0 +1,28 @@ + 'boolean']; + } + + public function consultation(): BelongsTo + { + return $this->belongsTo(Consultation::class, 'consultation_id'); + } +} diff --git a/app/Models/DispensingRecord.php b/app/Models/DispensingRecord.php new file mode 100644 index 0000000..745efbe --- /dev/null +++ b/app/Models/DispensingRecord.php @@ -0,0 +1,39 @@ + 'datetime']; + } + + public function prescription(): BelongsTo + { + return $this->belongsTo(Prescription::class, 'prescription_id'); + } + + public function prescriptionItem(): BelongsTo + { + return $this->belongsTo(PrescriptionItem::class, 'prescription_item_id'); + } + + public function drugBatch(): BelongsTo + { + return $this->belongsTo(DrugBatch::class, 'drug_batch_id'); + } +} diff --git a/app/Models/Drug.php b/app/Models/Drug.php new file mode 100644 index 0000000..257c80f --- /dev/null +++ b/app/Models/Drug.php @@ -0,0 +1,46 @@ + 'boolean']; + } + + public function organization(): BelongsTo + { + return $this->belongsTo(Organization::class, 'organization_id'); + } + + public function branch(): BelongsTo + { + return $this->belongsTo(Branch::class, 'branch_id'); + } + + public function batches(): HasMany + { + return $this->hasMany(DrugBatch::class, 'drug_id'); + } + + public function stockOnHand(): int + { + return (int) $this->batches()->sum('quantity_on_hand'); + } +} diff --git a/app/Models/DrugBatch.php b/app/Models/DrugBatch.php new file mode 100644 index 0000000..3a1b717 --- /dev/null +++ b/app/Models/DrugBatch.php @@ -0,0 +1,43 @@ + 'date', + 'received_at' => 'datetime', + ]; + } + + public function drug(): BelongsTo + { + return $this->belongsTo(Drug::class, 'drug_id'); + } + + public function dispensingRecords(): HasMany + { + return $this->hasMany(DispensingRecord::class, 'drug_batch_id'); + } + + public function isExpired(): bool + { + return $this->expiry_date !== null && $this->expiry_date->isPast(); + } +} diff --git a/app/Models/EmergencyContact.php b/app/Models/EmergencyContact.php new file mode 100644 index 0000000..95fd2f6 --- /dev/null +++ b/app/Models/EmergencyContact.php @@ -0,0 +1,26 @@ + 'boolean']; + } + + public function patient(): BelongsTo + { + return $this->belongsTo(Patient::class, 'patient_id'); + } +} diff --git a/app/Models/InsurancePolicy.php b/app/Models/InsurancePolicy.php new file mode 100644 index 0000000..8b54ec7 --- /dev/null +++ b/app/Models/InsurancePolicy.php @@ -0,0 +1,29 @@ + 'date']; + } + + public function patient(): BelongsTo + { + return $this->belongsTo(Patient::class, 'patient_id'); + } +} diff --git a/app/Models/InvestigationAttachment.php b/app/Models/InvestigationAttachment.php new file mode 100644 index 0000000..3f97292 --- /dev/null +++ b/app/Models/InvestigationAttachment.php @@ -0,0 +1,24 @@ +belongsTo(InvestigationResult::class, 'investigation_result_id'); + } +} diff --git a/app/Models/InvestigationRequest.php b/app/Models/InvestigationRequest.php new file mode 100644 index 0000000..96cda6f --- /dev/null +++ b/app/Models/InvestigationRequest.php @@ -0,0 +1,115 @@ + 'datetime', + 'completed_at' => 'datetime', + 'delivered_at' => 'datetime', + 'approved_at' => 'datetime', + ]; + } + + protected static function booted(): void + { + static::creating(function (InvestigationRequest $request) { + if (! $request->uuid) { + $request->uuid = (string) Str::uuid(); + } + }); + } + + public function getRouteKeyName(): string + { + return 'uuid'; + } + + public function investigationType(): BelongsTo + { + return $this->belongsTo(InvestigationType::class, 'investigation_type_id'); + } + + public function patient(): BelongsTo + { + return $this->belongsTo(Patient::class, 'patient_id'); + } + + public function visit(): BelongsTo + { + return $this->belongsTo(Visit::class, 'visit_id'); + } + + public function consultation(): BelongsTo + { + return $this->belongsTo(Consultation::class, 'consultation_id'); + } + + public function practitioner(): BelongsTo + { + return $this->belongsTo(Practitioner::class, 'practitioner_id'); + } + + public function branch(): BelongsTo + { + return $this->belongsTo(Branch::class, 'branch_id'); + } + + public function assignedMember(): BelongsTo + { + return $this->belongsTo(Member::class, 'assigned_member_id'); + } + + public function result(): HasOne + { + return $this->hasOne(InvestigationResult::class, 'investigation_request_id'); + } + + /** @return list */ + public static function activeStatuses(): array + { + return [ + self::STATUS_PENDING, + self::STATUS_SAMPLE_COLLECTED, + self::STATUS_IN_PROGRESS, + self::STATUS_AWAITING_REVIEW, + self::STATUS_COMPLETED, + ]; + } +} diff --git a/app/Models/InvestigationResult.php b/app/Models/InvestigationResult.php new file mode 100644 index 0000000..8bc8507 --- /dev/null +++ b/app/Models/InvestigationResult.php @@ -0,0 +1,47 @@ + 'boolean', + 'approved_at' => 'datetime', + ]; + } + + public function request(): BelongsTo + { + return $this->belongsTo(InvestigationRequest::class, 'investigation_request_id'); + } + + public function values(): HasMany + { + return $this->hasMany(InvestigationResultValue::class, 'investigation_result_id'); + } + + public function attachments(): HasMany + { + return $this->hasMany(InvestigationAttachment::class, 'investigation_result_id'); + } +} diff --git a/app/Models/InvestigationResultValue.php b/app/Models/InvestigationResultValue.php new file mode 100644 index 0000000..2068ace --- /dev/null +++ b/app/Models/InvestigationResultValue.php @@ -0,0 +1,33 @@ + 'decimal:4', + 'reference_high' => 'decimal:4', + 'is_abnormal' => 'boolean', + ]; + } + + public function result(): BelongsTo + { + return $this->belongsTo(InvestigationResult::class, 'investigation_result_id'); + } +} diff --git a/app/Models/InvestigationType.php b/app/Models/InvestigationType.php new file mode 100644 index 0000000..aa8425a --- /dev/null +++ b/app/Models/InvestigationType.php @@ -0,0 +1,40 @@ + 'decimal:4', + 'reference_high' => 'decimal:4', + 'is_active' => 'boolean', + ]; + } + + public function organization(): BelongsTo + { + return $this->belongsTo(Organization::class, 'organization_id'); + } + + public function requests(): HasMany + { + return $this->hasMany(InvestigationRequest::class, 'investigation_type_id'); + } +} diff --git a/app/Models/Member.php b/app/Models/Member.php new file mode 100644 index 0000000..6f69999 --- /dev/null +++ b/app/Models/Member.php @@ -0,0 +1,31 @@ +belongsTo(Organization::class, 'organization_id'); + } + + public function branch(): BelongsTo + { + return $this->belongsTo(Branch::class, 'branch_id'); + } + + public function hasRole(string ...$roles): bool + { + return in_array($this->role, $roles, true); + } +} diff --git a/app/Models/Organization.php b/app/Models/Organization.php new file mode 100644 index 0000000..9951b5f --- /dev/null +++ b/app/Models/Organization.php @@ -0,0 +1,34 @@ + 'array']; + } + + public function branches(): HasMany + { + return $this->hasMany(Branch::class, 'organization_id'); + } + + public function members(): HasMany + { + return $this->hasMany(Member::class, 'organization_id'); + } +} diff --git a/app/Models/Patient.php b/app/Models/Patient.php new file mode 100644 index 0000000..6f517a3 --- /dev/null +++ b/app/Models/Patient.php @@ -0,0 +1,116 @@ + 'date']; + } + + protected static function booted(): void + { + static::creating(function (Patient $patient) { + if (! $patient->uuid) { + $patient->uuid = (string) Str::uuid(); + } + }); + } + + public function getRouteKeyName(): string + { + return 'uuid'; + } + + public function fullName(): string + { + return trim(implode(' ', array_filter([ + $this->first_name, + $this->other_names, + $this->last_name, + ]))); + } + + public function organization(): BelongsTo + { + return $this->belongsTo(Organization::class, 'organization_id'); + } + + public function branch(): BelongsTo + { + return $this->belongsTo(Branch::class, 'branch_id'); + } + + public function allergies(): HasMany + { + return $this->hasMany(PatientAllergy::class, 'patient_id'); + } + + public function conditions(): HasMany + { + return $this->hasMany(PatientCondition::class, 'patient_id'); + } + + public function familyHistory(): HasMany + { + return $this->hasMany(PatientFamilyHistory::class, 'patient_id'); + } + + public function emergencyContacts(): HasMany + { + return $this->hasMany(EmergencyContact::class, 'patient_id'); + } + + public function insurancePolicies(): HasMany + { + return $this->hasMany(InsurancePolicy::class, 'patient_id'); + } + + public function attachments(): HasMany + { + return $this->hasMany(PatientAttachment::class, 'patient_id'); + } + + public function appointments(): HasMany + { + return $this->hasMany(Appointment::class, 'patient_id'); + } + + public function visits(): HasMany + { + return $this->hasMany(Visit::class, 'patient_id'); + } + + public function investigationRequests(): HasMany + { + return $this->hasMany(InvestigationRequest::class, 'patient_id'); + } + + public function prescriptions(): HasMany + { + return $this->hasMany(Prescription::class, 'patient_id'); + } + + public function bills(): HasMany + { + return $this->hasMany(Bill::class, 'patient_id'); + } +} diff --git a/app/Models/PatientAllergy.php b/app/Models/PatientAllergy.php new file mode 100644 index 0000000..0781fcd --- /dev/null +++ b/app/Models/PatientAllergy.php @@ -0,0 +1,21 @@ +belongsTo(Patient::class, 'patient_id'); + } +} diff --git a/app/Models/PatientAttachment.php b/app/Models/PatientAttachment.php new file mode 100644 index 0000000..0db98d7 --- /dev/null +++ b/app/Models/PatientAttachment.php @@ -0,0 +1,32 @@ +belongsTo(Patient::class, 'patient_id'); + } + + public function url(): ?string + { + return $this->file_path && Storage::disk('public')->exists($this->file_path) + ? Storage::disk('public')->url($this->file_path) + : null; + } +} diff --git a/app/Models/PatientCondition.php b/app/Models/PatientCondition.php new file mode 100644 index 0000000..9a537fb --- /dev/null +++ b/app/Models/PatientCondition.php @@ -0,0 +1,29 @@ + 'date', + 'is_chronic' => 'boolean', + ]; + } + + public function patient(): BelongsTo + { + return $this->belongsTo(Patient::class, 'patient_id'); + } +} diff --git a/app/Models/PatientFamilyHistory.php b/app/Models/PatientFamilyHistory.php new file mode 100644 index 0000000..1a056a5 --- /dev/null +++ b/app/Models/PatientFamilyHistory.php @@ -0,0 +1,21 @@ +belongsTo(Patient::class, 'patient_id'); + } +} diff --git a/app/Models/Payment.php b/app/Models/Payment.php new file mode 100644 index 0000000..abc73b8 --- /dev/null +++ b/app/Models/Payment.php @@ -0,0 +1,44 @@ + 'datetime']; + } + + protected static function booted(): void + { + static::creating(function (Payment $payment) { + if (! $payment->uuid) { + $payment->uuid = (string) Str::uuid(); + } + }); + } + + public function getRouteKeyName(): string + { + return 'uuid'; + } + + public function bill(): BelongsTo + { + return $this->belongsTo(Bill::class, 'bill_id'); + } +} diff --git a/app/Models/Practitioner.php b/app/Models/Practitioner.php new file mode 100644 index 0000000..db775f7 --- /dev/null +++ b/app/Models/Practitioner.php @@ -0,0 +1,56 @@ + 'boolean']; + } + + public function organization(): BelongsTo + { + return $this->belongsTo(Organization::class, 'organization_id'); + } + + public function branch(): BelongsTo + { + return $this->belongsTo(Branch::class, 'branch_id'); + } + + public function department(): BelongsTo + { + return $this->belongsTo(Department::class, 'department_id'); + } + + public function member(): BelongsTo + { + return $this->belongsTo(Member::class, 'member_id'); + } + + public function schedules(): HasMany + { + return $this->hasMany(PractitionerSchedule::class, 'practitioner_id'); + } + + public function appointments(): HasMany + { + return $this->hasMany(Appointment::class, 'practitioner_id'); + } +} diff --git a/app/Models/PractitionerSchedule.php b/app/Models/PractitionerSchedule.php new file mode 100644 index 0000000..bee17bd --- /dev/null +++ b/app/Models/PractitionerSchedule.php @@ -0,0 +1,21 @@ +belongsTo(Practitioner::class, 'practitioner_id'); + } +} diff --git a/app/Models/Prescription.php b/app/Models/Prescription.php new file mode 100644 index 0000000..04ef6e0 --- /dev/null +++ b/app/Models/Prescription.php @@ -0,0 +1,75 @@ + 'datetime']; + } + + protected static function booted(): void + { + static::creating(function (Prescription $prescription) { + if (! $prescription->uuid) { + $prescription->uuid = (string) Str::uuid(); + } + }); + } + + public function getRouteKeyName(): string + { + return 'uuid'; + } + + public function patient(): BelongsTo + { + return $this->belongsTo(Patient::class, 'patient_id'); + } + + public function visit(): BelongsTo + { + return $this->belongsTo(Visit::class, 'visit_id'); + } + + public function consultation(): BelongsTo + { + return $this->belongsTo(Consultation::class, 'consultation_id'); + } + + public function practitioner(): BelongsTo + { + return $this->belongsTo(Practitioner::class, 'practitioner_id'); + } + + public function items(): HasMany + { + return $this->hasMany(PrescriptionItem::class, 'prescription_id')->orderBy('sort_order'); + } +} diff --git a/app/Models/PrescriptionItem.php b/app/Models/PrescriptionItem.php new file mode 100644 index 0000000..9f835ca --- /dev/null +++ b/app/Models/PrescriptionItem.php @@ -0,0 +1,34 @@ + 'boolean']; + } + + public function prescription(): BelongsTo + { + return $this->belongsTo(Prescription::class, 'prescription_id'); + } + + public function drug(): BelongsTo + { + return $this->belongsTo(Drug::class, 'drug_id'); + } +} diff --git a/app/Models/User.php b/app/Models/User.php new file mode 100644 index 0000000..1f15e02 --- /dev/null +++ b/app/Models/User.php @@ -0,0 +1,41 @@ + 'datetime', + 'last_app_active_at' => 'datetime', + 'password' => 'hashed', + ]; + } + + public function ownerRef(): string + { + return (string) $this->public_id; + } + + public function avatarUrl(): ?string + { + $url = trim((string) $this->avatar_url); + + return $url !== '' ? $url : null; + } +} diff --git a/app/Models/Visit.php b/app/Models/Visit.php new file mode 100644 index 0000000..3d023ca --- /dev/null +++ b/app/Models/Visit.php @@ -0,0 +1,86 @@ + 'datetime', + 'completed_at' => 'datetime', + ]; + } + + protected static function booted(): void + { + static::creating(function (Visit $visit) { + if (! $visit->uuid) { + $visit->uuid = (string) Str::uuid(); + } + }); + } + + public function getRouteKeyName(): string + { + return 'uuid'; + } + + public function patient(): BelongsTo + { + return $this->belongsTo(Patient::class, 'patient_id'); + } + + public function branch(): BelongsTo + { + return $this->belongsTo(Branch::class, 'branch_id'); + } + + public function organization(): BelongsTo + { + return $this->belongsTo(Organization::class, 'organization_id'); + } + + public function appointment(): HasOne + { + return $this->hasOne(Appointment::class, 'visit_id'); + } + + public function consultations(): HasMany + { + return $this->hasMany(Consultation::class, 'visit_id'); + } + + public function bill(): HasOne + { + return $this->hasOne(Bill::class, 'visit_id'); + } + + public function bills(): HasMany + { + return $this->hasMany(Bill::class, 'visit_id'); + } +} diff --git a/app/Models/VitalSign.php b/app/Models/VitalSign.php new file mode 100644 index 0000000..690a6e4 --- /dev/null +++ b/app/Models/VitalSign.php @@ -0,0 +1,35 @@ + 'decimal:1', + 'weight_kg' => 'decimal:2', + 'height_cm' => 'decimal:1', + 'recorded_at' => 'datetime', + ]; + } + + public function consultation(): BelongsTo + { + return $this->belongsTo(Consultation::class, 'consultation_id'); + } +} diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php new file mode 100644 index 0000000..7bda633 --- /dev/null +++ b/app/Providers/AppServiceProvider.php @@ -0,0 +1,44 @@ +user(); + $isPro = false; + + if ($user) { + $organization = app(OrganizationResolver::class)->resolveForUser($user); + if ($organization) { + $isPro = app(PlanService::class)->isPro($organization); + } + } + + $view->with('isPro', $isPro); + }); + + View::composer(['partials.topbar'], function ($view) { + $view->with(\App\Support\MobileTopbar::resolve()); + }); + } +} diff --git a/app/Services/Billing/BillingClient.php b/app/Services/Billing/BillingClient.php new file mode 100644 index 0000000..4b97295 --- /dev/null +++ b/app/Services/Billing/BillingClient.php @@ -0,0 +1,64 @@ +token())->acceptJson()->timeout(8) + ->get($this->base().'/balance', ['user' => $publicId]); + $res->throw(); + + return (int) ($res->json('balance_minor') ?? 0); + } + + public function canAfford(string $publicId, int $amountMinor): bool + { + $res = Http::withToken($this->token())->acceptJson()->timeout(8) + ->get($this->base().'/can-afford', ['user' => $publicId, 'amount_minor' => $amountMinor]); + $res->throw(); + + return (bool) ($res->json('affordable') ?? false); + } + + /** + * Debit the wallet. Returns true on success, false on insufficient balance + * (HTTP 402). Idempotent by $reference. + */ + public function debit(string $publicId, int $amountMinor, string $source, string $reference, ?string $description = null): bool + { + $res = Http::withToken($this->token())->acceptJson()->timeout(10)->post($this->base().'/debit', array_filter([ + 'user' => $publicId, + 'amount_minor' => $amountMinor, + 'service' => (string) config('billing.service', 'crm'), + 'source' => $source, + 'reference' => $reference, + 'description' => $description, + ], static fn ($v) => $v !== null)); + + if ($res->status() === 402) { + return false; + } + $res->throw(); + + return true; + } +} diff --git a/app/Services/Billing/OneTimePurchaseService.php b/app/Services/Billing/OneTimePurchaseService.php new file mode 100644 index 0000000..6fd9aa7 --- /dev/null +++ b/app/Services/Billing/OneTimePurchaseService.php @@ -0,0 +1,76 @@ +|null */ + public function product(string $productKey): ?array + { + $product = config('crm_products.'.$productKey); + + return is_array($product) ? $product : null; + } + + public function hasPurchased(string $ownerRef, string $productKey): bool + { + return CrmPurchase::has($ownerRef, $productKey); + } + + public function priceMinor(string $productKey): int + { + return (int) ($this->product($productKey)['price_minor'] ?? 0); + } + + public function purchase(string $ownerRef, string $productKey): bool + { + if ($this->hasPurchased($ownerRef, $productKey)) { + return true; + } + + $product = $this->product($productKey); + if (! $product) { + return false; + } + + $costMinor = (int) ($product['price_minor'] ?? 0); + + if ($costMinor > 0) { + try { + if (! $this->billing->canAfford($ownerRef, $costMinor)) { + return false; + } + + $charged = $this->billing->debit( + $ownerRef, + $costMinor, + 'purchase', + 'crm-purchase-'.$productKey.'-'.$ownerRef, + 'CRM: '.($product['name'] ?? $productKey), + ); + + if (! $charged) { + return false; + } + } catch (\Throwable) { + return false; + } + } + + CrmPurchase::create([ + 'owner_ref' => $ownerRef, + 'product_key' => $productKey, + 'cost_minor' => $costMinor, + 'purchased_at' => now(), + ]); + + return true; + } +} diff --git a/app/Services/Care/AppointmentService.php b/app/Services/Care/AppointmentService.php new file mode 100644 index 0000000..f1ab18a --- /dev/null +++ b/app/Services/Care/AppointmentService.php @@ -0,0 +1,283 @@ +where('organization_id', $organizationId); + } + + /** + * @param array $filters + */ + public function list(string $ownerRef, int $organizationId, array $filters = [], ?int $branchId = null): LengthAwarePaginator + { + $query = $this->queryForOrganization($ownerRef, $organizationId) + ->with(['patient', 'practitioner', 'branch', 'department']) + ->orderByDesc('scheduled_at'); + + if ($branchId !== null) { + $query->where('branch_id', $branchId); + } + + if ($status = $filters['status'] ?? null) { + $query->where('status', $status); + } + + if ($practitionerId = $filters['practitioner_id'] ?? null) { + $query->where('practitioner_id', $practitionerId); + } + + if ($date = $filters['date'] ?? null) { + $query->whereDate('scheduled_at', Carbon::parse($date)->toDateString()); + } + + if ($patientId = $filters['patient_id'] ?? null) { + $query->where('patient_id', $patientId); + } + + return $query->paginate((int) ($filters['per_page'] ?? 20))->withQueryString(); + } + + /** + * @return Collection + */ + public function queue(string $ownerRef, int $branchId, ?int $practitionerId = null): Collection + { + $query = Appointment::owned($ownerRef) + ->where('branch_id', $branchId) + ->whereIn('status', [Appointment::STATUS_WAITING, Appointment::STATUS_CHECKED_IN]) + ->with(['patient', 'practitioner']) + ->orderBy('queue_position') + ->orderBy('waiting_at') + ->orderBy('checked_in_at'); + + if ($practitionerId !== null) { + $query->where(function (Builder $q) use ($practitionerId) { + $q->where('practitioner_id', $practitionerId)->orWhereNull('practitioner_id'); + }); + } + + return $query->get(); + } + + /** + * @param array $data + */ + public function book(Organization $organization, string $ownerRef, array $data, ?string $actorRef = null): Appointment + { + $appointment = Appointment::create([ + 'owner_ref' => $ownerRef, + 'organization_id' => $organization->id, + 'branch_id' => $data['branch_id'], + 'patient_id' => $data['patient_id'], + 'practitioner_id' => $data['practitioner_id'] ?? null, + 'department_id' => $data['department_id'] ?? null, + 'type' => Appointment::TYPE_SCHEDULED, + 'status' => Appointment::STATUS_SCHEDULED, + 'scheduled_at' => $data['scheduled_at'], + 'reason' => $data['reason'] ?? null, + 'notes' => $data['notes'] ?? null, + 'created_by' => $actorRef, + ]); + + AuditLogger::record($ownerRef, 'appointment.created', $organization->id, $actorRef, Appointment::class, $appointment->id); + + return $appointment->load(['patient', 'practitioner', 'branch']); + } + + /** + * @param array $data + */ + public function walkIn(Organization $organization, string $ownerRef, array $data, ?string $actorRef = null): Appointment + { + $visit = $this->visits->checkIn( + $organization, + $ownerRef, + Patient::findOrFail($data['patient_id']), + (int) $data['branch_id'], + $actorRef, + ); + + $appointment = Appointment::create([ + 'owner_ref' => $ownerRef, + 'organization_id' => $organization->id, + 'branch_id' => $data['branch_id'], + 'patient_id' => $data['patient_id'], + 'practitioner_id' => $data['practitioner_id'] ?? null, + 'department_id' => $data['department_id'] ?? null, + 'visit_id' => $visit->id, + 'type' => Appointment::TYPE_WALK_IN, + 'status' => Appointment::STATUS_WAITING, + 'scheduled_at' => now(), + 'checked_in_at' => now(), + 'waiting_at' => now(), + 'queue_position' => $this->nextQueuePosition($ownerRef, (int) $data['branch_id']), + 'reason' => $data['reason'] ?? 'Walk-in', + 'notes' => $data['notes'] ?? null, + 'created_by' => $actorRef, + ]); + + AuditLogger::record($ownerRef, 'appointment.walk_in', $organization->id, $actorRef, Appointment::class, $appointment->id); + + return $appointment->load(['patient', 'practitioner', 'branch', 'visit']); + } + + public function checkIn(Appointment $appointment, string $ownerRef, ?string $actorRef = null): Appointment + { + $this->assertTransition($appointment, Appointment::STATUS_SCHEDULED); + + $visit = $this->visits->checkIn( + $appointment->organization, + $ownerRef, + $appointment->patient, + $appointment->branch_id, + $actorRef, + ); + + $appointment->update([ + 'visit_id' => $visit->id, + 'status' => Appointment::STATUS_WAITING, + 'checked_in_at' => now(), + 'waiting_at' => now(), + 'queue_position' => $this->nextQueuePosition($ownerRef, $appointment->branch_id), + ]); + + AuditLogger::record($ownerRef, 'appointment.checked_in', $appointment->organization_id, $actorRef, Appointment::class, $appointment->id); + + return $appointment->fresh(['patient', 'practitioner', 'visit']); + } + + public function markWaiting(Appointment $appointment, string $ownerRef, ?string $actorRef = null): Appointment + { + if (! in_array($appointment->status, [Appointment::STATUS_CHECKED_IN, Appointment::STATUS_SCHEDULED], true)) { + $this->assertTransition($appointment, Appointment::STATUS_CHECKED_IN); + } + + $updates = [ + 'status' => Appointment::STATUS_WAITING, + 'waiting_at' => $appointment->waiting_at ?? now(), + ]; + + if ($appointment->queue_position === null) { + $updates['queue_position'] = $this->nextQueuePosition($ownerRef, $appointment->branch_id); + } + + $appointment->update($updates); + AuditLogger::record($ownerRef, 'appointment.waiting', $appointment->organization_id, $actorRef, Appointment::class, $appointment->id); + + return $appointment->fresh(['patient', 'practitioner']); + } + + public function startConsultation(Appointment $appointment, string $ownerRef, ?int $practitionerId = null, ?string $actorRef = null): Appointment + { + $this->assertTransition($appointment, Appointment::STATUS_WAITING, Appointment::STATUS_CHECKED_IN); + + if ($appointment->visit_id === null) { + $visit = $this->visits->checkIn( + $appointment->organization, + $ownerRef, + $appointment->patient, + $appointment->branch_id, + $actorRef, + ); + $appointment->update(['visit_id' => $visit->id, 'checked_in_at' => now()]); + } + + $appointment->visit->update(['status' => Visit::STATUS_IN_PROGRESS]); + + $appointment->update([ + 'status' => Appointment::STATUS_IN_CONSULTATION, + 'started_at' => now(), + 'practitioner_id' => $practitionerId ?? $appointment->practitioner_id, + ]); + + AuditLogger::record($ownerRef, 'appointment.in_consultation', $appointment->organization_id, $actorRef, Appointment::class, $appointment->id); + + return $appointment->fresh(['patient', 'practitioner', 'visit']); + } + + public function complete(Appointment $appointment, string $ownerRef, ?string $actorRef = null): Appointment + { + $this->assertTransition($appointment, Appointment::STATUS_IN_CONSULTATION); + + $appointment->update([ + 'status' => Appointment::STATUS_COMPLETED, + 'completed_at' => now(), + ]); + + if ($appointment->visit) { + $this->visits->complete($appointment->visit, $ownerRef, $actorRef); + } + + AuditLogger::record($ownerRef, 'appointment.completed', $appointment->organization_id, $actorRef, Appointment::class, $appointment->id); + + return $appointment->fresh(['patient', 'practitioner', 'visit']); + } + + public function cancel(Appointment $appointment, string $ownerRef, ?string $actorRef = null): Appointment + { + if (in_array($appointment->status, [Appointment::STATUS_COMPLETED, Appointment::STATUS_CANCELLED], true)) { + throw new InvalidArgumentException('Appointment cannot be cancelled.'); + } + + $appointment->update([ + 'status' => Appointment::STATUS_CANCELLED, + 'cancelled_at' => now(), + ]); + + AuditLogger::record($ownerRef, 'appointment.cancelled', $appointment->organization_id, $actorRef, Appointment::class, $appointment->id); + + return $appointment->fresh(['patient', 'practitioner']); + } + + public function markNoShow(Appointment $appointment, string $ownerRef, ?string $actorRef = null): Appointment + { + $this->assertTransition($appointment, Appointment::STATUS_SCHEDULED); + + $appointment->update(['status' => Appointment::STATUS_NO_SHOW]); + AuditLogger::record($ownerRef, 'appointment.no_show', $appointment->organization_id, $actorRef, Appointment::class, $appointment->id); + + return $appointment->fresh(['patient', 'practitioner']); + } + + public function callNext(string $ownerRef, int $branchId, ?int $practitionerId = null): ?Appointment + { + $next = $this->queue($ownerRef, $branchId, $practitionerId)->first(); + + return $next; + } + + protected function nextQueuePosition(string $ownerRef, int $branchId): int + { + $max = Appointment::owned($ownerRef) + ->where('branch_id', $branchId) + ->whereIn('status', [Appointment::STATUS_WAITING, Appointment::STATUS_CHECKED_IN]) + ->max('queue_position'); + + return ($max ?? 0) + 1; + } + + protected function assertTransition(Appointment $appointment, string ...$allowedFrom): void + { + if (! in_array($appointment->status, $allowedFrom, true)) { + throw new InvalidArgumentException("Cannot transition from {$appointment->status}."); + } + } +} diff --git a/app/Services/Care/AuditLogger.php b/app/Services/Care/AuditLogger.php new file mode 100644 index 0000000..3d71e2a --- /dev/null +++ b/app/Services/Care/AuditLogger.php @@ -0,0 +1,29 @@ +where('organization_id', $organizationId); + } + + /** + * @param array $filters + */ + public function list(string $ownerRef, int $organizationId, array $filters = [], ?int $branchId = null): LengthAwarePaginator + { + $query = $this->queryForOrganization($ownerRef, $organizationId) + ->with(['patient', 'branch', 'visit']) + ->orderByDesc('created_at'); + + if ($branchId !== null) { + $query->where('branch_id', $branchId); + } + + if ($status = $filters['status'] ?? null) { + $query->where('status', $status); + } + + if ($patientId = $filters['patient_id'] ?? null) { + $query->where('patient_id', $patientId); + } + + return $query->paginate((int) ($filters['per_page'] ?? 20))->withQueryString(); + } + + public function generateFromVisit(Visit $visit, string $ownerRef, ?string $actorRef = null): Bill + { + $existing = Bill::owned($ownerRef) + ->where('visit_id', $visit->id) + ->whereNotIn('status', [Bill::STATUS_VOID]) + ->first(); + + if ($existing) { + return $this->syncLineItemsFromVisit($existing, $ownerRef, $actorRef); + } + + $visit->load(['patient', 'consultations', 'organization']); + + $bill = Bill::create([ + 'owner_ref' => $ownerRef, + 'organization_id' => $visit->organization_id, + 'branch_id' => $visit->branch_id, + 'visit_id' => $visit->id, + 'patient_id' => $visit->patient_id, + 'invoice_number' => $this->invoices->generate($visit->organization), + 'status' => Bill::STATUS_OPEN, + 'created_by' => $actorRef, + ]); + + $this->syncLineItemsFromVisit($bill, $ownerRef, $actorRef); + + AuditLogger::record($ownerRef, 'bill.created', $visit->organization_id, $actorRef, Bill::class, $bill->id); + + return $bill->fresh(['lineItems', 'patient', 'payments']); + } + + public function syncLineItemsFromVisit(Bill $bill, string $ownerRef, ?string $actorRef = null): Bill + { + if (in_array($bill->status, [Bill::STATUS_PAID, Bill::STATUS_VOID], true)) { + return $bill; + } + + $visit = $bill->visit()->with(['consultations'])->firstOrFail(); + + $bill->lineItems()->whereNotNull('source_type')->delete(); + + if ($visit->consultations()->where('status', 'completed')->exists()) { + $fee = (int) config('care.billing.consultation_fee_minor', 5000); + $this->addLineItem($bill, $ownerRef, [ + 'type' => 'consultation', + 'description' => 'Consultation fee', + 'quantity' => 1, + 'unit_price_minor' => $fee, + 'source_type' => Visit::class, + 'source_id' => $visit->id, + ]); + } + + InvestigationRequest::owned($ownerRef) + ->where('visit_id', $visit->id) + ->whereIn('status', [InvestigationRequest::STATUS_COMPLETED, InvestigationRequest::STATUS_DELIVERED]) + ->with('investigationType') + ->get() + ->each(function (InvestigationRequest $request) use ($bill, $ownerRef) { + $this->addLineItem($bill, $ownerRef, [ + 'type' => 'lab', + 'description' => $request->investigationType->name, + 'quantity' => 1, + 'unit_price_minor' => $request->investigationType->price_minor, + 'source_type' => InvestigationRequest::class, + 'source_id' => $request->id, + ]); + }); + + Prescription::owned($ownerRef) + ->where('visit_id', $visit->id) + ->where('status', Prescription::STATUS_DISPENSED) + ->with('items.drug') + ->get() + ->each(function (Prescription $rx) use ($bill, $ownerRef) { + foreach ($rx->items as $item) { + if ($item->is_procedure) { + $this->addLineItem($bill, $ownerRef, [ + 'type' => 'procedure', + 'description' => $item->name, + 'quantity' => 1, + 'unit_price_minor' => 0, + 'source_type' => Prescription::class, + 'source_id' => $rx->id, + ]); + + continue; + } + + $price = $item->drug?->unit_price_minor ?? 0; + $qty = max(1, (int) preg_replace('/\D/', '', (string) $item->quantity) ?: 1); + $this->addLineItem($bill, $ownerRef, [ + 'type' => 'pharmacy', + 'description' => $item->name, + 'quantity' => $qty, + 'unit_price_minor' => $price, + 'source_type' => Prescription::class, + 'source_id' => $rx->id, + ]); + } + }); + + $this->recalculate($bill); + AuditLogger::record($ownerRef, 'bill.updated', $bill->organization_id, $actorRef, Bill::class, $bill->id); + + return $bill->fresh(['lineItems', 'payments', 'patient']); + } + + /** + * @param array $data + */ + public function addLineItem(Bill $bill, string $ownerRef, array $data): BillLineItem + { + $this->assertEditable($bill); + + $quantity = max(1, (int) ($data['quantity'] ?? 1)); + $unitPrice = (int) ($data['unit_price_minor'] ?? 0); + + return BillLineItem::create([ + 'owner_ref' => $ownerRef, + 'bill_id' => $bill->id, + 'type' => $data['type'] ?? 'misc', + 'description' => $data['description'], + 'quantity' => $quantity, + 'unit_price_minor' => $unitPrice, + 'total_minor' => $quantity * $unitPrice, + 'source_type' => $data['source_type'] ?? null, + 'source_id' => $data['source_id'] ?? null, + ]); + } + + /** + * @param array $data + */ + public function addManualLineItem(Bill $bill, string $ownerRef, array $data, ?string $actorRef = null): Bill + { + $this->addLineItem($bill, $ownerRef, $data); + $this->recalculate($bill); + AuditLogger::record($ownerRef, 'bill.line_item_added', $bill->organization_id, $actorRef, Bill::class, $bill->id); + + return $bill->fresh(['lineItems', 'payments']); + } + + public function applyAdjustments(Bill $bill, string $ownerRef, int $discountMinor = 0, int $taxMinor = 0, ?string $actorRef = null): Bill + { + $this->assertEditable($bill); + + $bill->update([ + 'discount_minor' => max(0, $discountMinor), + 'tax_minor' => max(0, $taxMinor), + ]); + + $this->recalculate($bill); + AuditLogger::record($ownerRef, 'bill.updated', $bill->organization_id, $actorRef, Bill::class, $bill->id); + + return $bill->fresh(['lineItems', 'payments']); + } + + /** + * @param array $data + */ + public function recordPayment(Bill $bill, string $ownerRef, array $data, ?string $actorRef = null): Payment + { + if ($bill->status === Bill::STATUS_VOID) { + throw new InvalidArgumentException('Cannot pay a void bill.'); + } + + $amount = (int) $data['amount_minor']; + if ($amount <= 0) { + throw new InvalidArgumentException('Payment amount must be positive.'); + } + + $payment = Payment::create([ + 'owner_ref' => $ownerRef, + 'bill_id' => $bill->id, + 'amount_minor' => $amount, + 'method' => $data['method'] ?? 'cash', + 'reference' => $data['reference'] ?? null, + 'paid_at' => $data['paid_at'] ?? now(), + 'recorded_by' => $actorRef, + 'notes' => $data['notes'] ?? null, + ]); + + $bill->refresh(); + $paid = (int) $bill->payments()->sum('amount_minor'); + $balance = max(0, $bill->total_minor - $paid); + + $status = Bill::STATUS_OPEN; + if ($paid > 0 && $balance > 0) { + $status = Bill::STATUS_PARTIAL; + } elseif ($balance === 0 && $bill->total_minor > 0) { + $status = Bill::STATUS_PAID; + } elseif ($paid >= $bill->total_minor) { + $status = Bill::STATUS_PAID; + } + + $bill->update([ + 'amount_paid_minor' => $paid, + 'balance_minor' => $balance, + 'status' => $status, + ]); + + AuditLogger::record($ownerRef, 'payment.recorded', $bill->organization_id, $actorRef, Payment::class, $payment->id, [ + 'bill_id' => $bill->id, + 'amount_minor' => $amount, + ]); + + return $payment; + } + + public function void(Bill $bill, string $ownerRef, ?string $actorRef = null): Bill + { + if ($bill->status === Bill::STATUS_PAID) { + throw new InvalidArgumentException('Paid bills cannot be voided.'); + } + + $bill->update(['status' => Bill::STATUS_VOID, 'balance_minor' => 0]); + AuditLogger::record($ownerRef, 'bill.voided', $bill->organization_id, $actorRef, Bill::class, $bill->id); + + return $bill->fresh(); + } + + protected function recalculate(Bill $bill): void + { + $bill->refresh(); + $subtotal = (int) $bill->lineItems()->sum('total_minor'); + $total = max(0, $subtotal - $bill->discount_minor + $bill->tax_minor); + $paid = (int) $bill->payments()->sum('amount_minor'); + $balance = max(0, $total - $paid); + + $status = $bill->status; + if ($status !== Bill::STATUS_VOID) { + if ($paid === 0) { + $status = Bill::STATUS_OPEN; + } elseif ($balance > 0) { + $status = Bill::STATUS_PARTIAL; + } else { + $status = Bill::STATUS_PAID; + } + } + + $bill->update([ + 'subtotal_minor' => $subtotal, + 'total_minor' => $total, + 'amount_paid_minor' => $paid, + 'balance_minor' => $balance, + 'status' => $status, + ]); + } + + protected function assertEditable(Bill $bill): void + { + if (in_array($bill->status, [Bill::STATUS_PAID, Bill::STATUS_VOID], true)) { + throw new InvalidArgumentException('Bill cannot be modified.'); + } + } +} diff --git a/app/Services/Care/CarePermissions.php b/app/Services/Care/CarePermissions.php new file mode 100644 index 0000000..98158da --- /dev/null +++ b/app/Services/Care/CarePermissions.php @@ -0,0 +1,70 @@ +> */ + protected array $roleAbilities = [ + 'super_admin' => ['*'], + 'hospital_admin' => ['*'], + 'receptionist' => [ + 'dashboard.view', 'patients.view', 'patients.manage', + 'appointments.view', 'appointments.manage', 'queue.manage', + ], + 'doctor' => [ + 'dashboard.view', 'patients.view', 'appointments.view', + 'consultations.view', 'consultations.manage', + 'investigations.request', 'prescriptions.manage', 'lab.results.view', + ], + 'nurse' => [ + 'dashboard.view', 'patients.view', 'appointments.view', + 'consultations.view', 'vitals.manage', 'queue.manage', + ], + 'lab_technician' => [ + 'dashboard.view', 'patients.view', 'lab.view', 'lab.manage', + ], + 'pharmacist' => [ + 'dashboard.view', 'patients.view', 'prescriptions.view', 'prescriptions.dispense', + 'pharmacy.view', 'pharmacy.manage', + ], + 'cashier' => [ + 'dashboard.view', 'patients.view', 'bills.view', 'bills.manage', 'payments.manage', + ], + 'accountant' => [ + 'dashboard.view', 'bills.view', 'reports.finance.view', 'reports.finance.export', + 'audit.view', 'audit.export', + ], + ]; + + /** @var list */ + protected array $adminAbilities = [ + 'admin.branches.view', 'admin.branches.manage', + 'admin.departments.view', 'admin.departments.manage', + 'admin.members.view', 'admin.members.manage', + 'settings.view', 'settings.manage', + 'audit.view', 'audit.export', + ]; + + public function can(?Member $member, string $ability): bool + { + if ($member === null) { + return false; + } + + $abilities = $this->roleAbilities[$member->role] ?? []; + + if (in_array('*', $abilities, true)) { + return true; + } + + return in_array($ability, $abilities, true); + } + + public function isAdmin(?Member $member): bool + { + return $member !== null && in_array($member->role, ['super_admin', 'hospital_admin'], true); + } +} diff --git a/app/Services/Care/ConsultationService.php b/app/Services/Care/ConsultationService.php new file mode 100644 index 0000000..4ca6b69 --- /dev/null +++ b/app/Services/Care/ConsultationService.php @@ -0,0 +1,167 @@ +status !== Appointment::STATUS_IN_CONSULTATION) { + $this->appointments->startConsultation( + $appointment, + $ownerRef, + $appointment->practitioner_id, + $actorRef, + ); + $appointment->refresh(); + } + + $existing = Consultation::where('appointment_id', $appointment->id)->first(); + if ($existing) { + return $existing->load(['vitalSigns', 'diagnoses', 'documents', 'patient', 'practitioner']); + } + + $consultation = Consultation::create([ + 'owner_ref' => $ownerRef, + 'visit_id' => $appointment->visit_id, + 'appointment_id' => $appointment->id, + 'practitioner_id' => $appointment->practitioner_id, + 'patient_id' => $appointment->patient_id, + 'status' => Consultation::STATUS_DRAFT, + 'started_at' => now(), + ]); + + AuditLogger::record($ownerRef, 'consultation.started', $appointment->organization_id, $actorRef, Consultation::class, $consultation->id); + + return $consultation->load(['patient', 'practitioner', 'visit']); + } + + /** + * @param array $data + */ + public function save(Consultation $consultation, string $ownerRef, array $data, ?string $actorRef = null): Consultation + { + $consultation->update([ + 'symptoms' => $data['symptoms'] ?? $consultation->symptoms, + 'clinical_notes' => $data['clinical_notes'] ?? $consultation->clinical_notes, + 'practitioner_id' => $data['practitioner_id'] ?? $consultation->practitioner_id, + ]); + + if (array_key_exists('vitals', $data) && is_array($data['vitals'])) { + $this->saveVitals($consultation, $ownerRef, $data['vitals'], $actorRef); + } + + if (array_key_exists('diagnoses', $data)) { + $this->syncDiagnoses($consultation, $ownerRef, $data['diagnoses']); + } + + if (! empty($data['documents'])) { + $this->storeDocuments($consultation, $ownerRef, $data['documents'], $actorRef); + } + + AuditLogger::record($ownerRef, 'consultation.updated', $consultation->visit->organization_id, $actorRef, Consultation::class, $consultation->id); + + return $consultation->fresh(['vitalSigns', 'diagnoses', 'documents', 'patient', 'practitioner', 'visit', 'appointment']); + } + + public function complete(Consultation $consultation, string $ownerRef, ?string $actorRef = null): Consultation + { + $consultation->update([ + 'status' => Consultation::STATUS_COMPLETED, + 'completed_at' => now(), + 'completed_by' => $actorRef, + ]); + + if ($consultation->appointment) { + $this->appointments->complete($consultation->appointment, $ownerRef, $actorRef); + } elseif ($consultation->visit) { + app(VisitService::class)->complete($consultation->visit, $ownerRef, $actorRef); + } + + AuditLogger::record($ownerRef, 'consultation.completed', $consultation->visit->organization_id, $actorRef, Consultation::class, $consultation->id); + + return $consultation->fresh(['vitalSigns', 'diagnoses', 'documents', 'patient', 'practitioner']); + } + + /** + * @param array $vitals + */ + protected function saveVitals(Consultation $consultation, string $ownerRef, array $vitals, ?string $actorRef): void + { + if (empty(array_filter($vitals))) { + return; + } + + VitalSign::create([ + 'owner_ref' => $ownerRef, + 'consultation_id' => $consultation->id, + 'bp_systolic' => $vitals['bp_systolic'] ?? null, + 'bp_diastolic' => $vitals['bp_diastolic'] ?? null, + 'pulse' => $vitals['pulse'] ?? null, + 'temperature' => $vitals['temperature'] ?? null, + 'weight_kg' => $vitals['weight_kg'] ?? null, + 'height_cm' => $vitals['height_cm'] ?? null, + 'spo2' => $vitals['spo2'] ?? null, + 'respiratory_rate' => $vitals['respiratory_rate'] ?? null, + 'recorded_by' => $actorRef, + 'recorded_at' => now(), + ]); + } + + /** + * @param array> $rows + */ + protected function syncDiagnoses(Consultation $consultation, string $ownerRef, array $rows): void + { + $consultation->diagnoses()->delete(); + + foreach ($rows as $row) { + if (empty($row['description'])) { + continue; + } + Diagnosis::create([ + 'owner_ref' => $ownerRef, + 'consultation_id' => $consultation->id, + 'code' => $row['code'] ?? null, + 'description' => $row['description'], + 'is_primary' => (bool) ($row['is_primary'] ?? false), + 'notes' => $row['notes'] ?? null, + ]); + } + } + + /** + * @param array $files + */ + protected function storeDocuments(Consultation $consultation, string $ownerRef, array $files, ?string $actorRef): void + { + foreach ($files as $file) { + if (! $file instanceof UploadedFile) { + continue; + } + + $path = $file->store("care/consultations/{$consultation->id}/documents", 'public'); + + ConsultationDocument::create([ + 'owner_ref' => $ownerRef, + 'consultation_id' => $consultation->id, + 'file_path' => $path, + 'original_name' => $file->getClientOriginalName(), + 'mime_type' => $file->getMimeType(), + 'uploaded_by' => $actorRef, + ]); + } + } +} diff --git a/app/Services/Care/InvestigationService.php b/app/Services/Care/InvestigationService.php new file mode 100644 index 0000000..1f1eb2e --- /dev/null +++ b/app/Services/Care/InvestigationService.php @@ -0,0 +1,398 @@ +where('organization_id', $organizationId); + } + + /** + * @param array $filters + */ + public function list(string $ownerRef, int $organizationId, array $filters = [], ?int $branchId = null): LengthAwarePaginator + { + $query = $this->queryForOrganization($ownerRef, $organizationId) + ->with(['patient', 'investigationType', 'practitioner', 'branch', 'result']) + ->orderByDesc('created_at'); + + if ($branchId !== null) { + $query->where('branch_id', $branchId); + } + + if ($status = $filters['status'] ?? null) { + $query->where('status', $status); + } + + if ($patientId = $filters['patient_id'] ?? null) { + $query->where('patient_id', $patientId); + } + + return $query->paginate((int) ($filters['per_page'] ?? 20))->withQueryString(); + } + + /** + * @return Collection + */ + public function workQueue(string $ownerRef, int $branchId, ?string $status = null): Collection + { + $query = InvestigationRequest::owned($ownerRef) + ->where('branch_id', $branchId) + ->whereIn('status', InvestigationRequest::activeStatuses()) + ->with(['patient', 'investigationType', 'assignedMember', 'result']) + ->orderByRaw("CASE priority WHEN 'urgent' THEN 0 ELSE 1 END") + ->orderBy('created_at'); + + if ($status) { + $query->where('status', $status); + } + + return $query->get(); + } + + /** + * @param array $typeIds + * @return Collection + */ + public function requestFromConsultation( + Consultation $consultation, + string $ownerRef, + array $typeIds, + ?string $clinicalNotes = null, + string $priority = 'routine', + ?string $actorRef = null, + ): Collection { + $consultation->loadMissing('visit'); + $created = new Collection(); + + foreach ($typeIds as $typeId) { + $type = InvestigationType::owned($ownerRef)->findOrFail($typeId); + + $request = InvestigationRequest::create([ + 'owner_ref' => $ownerRef, + 'organization_id' => $consultation->visit->organization_id, + 'branch_id' => $consultation->visit->branch_id, + 'visit_id' => $consultation->visit_id, + 'consultation_id' => $consultation->id, + 'patient_id' => $consultation->patient_id, + 'investigation_type_id' => $type->id, + 'practitioner_id' => $consultation->practitioner_id, + 'status' => InvestigationRequest::STATUS_PENDING, + 'priority' => $priority, + 'clinical_notes' => $clinicalNotes, + 'requested_by' => $actorRef, + ]); + + AuditLogger::record( + $ownerRef, + 'investigation.requested', + $consultation->visit->organization_id, + $actorRef, + InvestigationRequest::class, + $request->id, + ); + + $created->push($request->load('investigationType')); + } + + return $created; + } + + public function collectSample( + InvestigationRequest $request, + string $ownerRef, + ?string $barcode = null, + ?string $actorRef = null, + ): InvestigationRequest { + $this->assertStatus($request, InvestigationRequest::STATUS_PENDING); + + $request->update([ + 'status' => InvestigationRequest::STATUS_SAMPLE_COLLECTED, + 'sample_barcode' => $barcode ?? $this->generateBarcode($request), + 'sample_collected_at' => now(), + 'sample_collected_by' => $actorRef, + ]); + + AuditLogger::record($ownerRef, 'investigation.sample_collected', $request->organization_id, $actorRef, InvestigationRequest::class, $request->id); + + return $request->fresh(['patient', 'investigationType']); + } + + public function startProcessing( + InvestigationRequest $request, + string $ownerRef, + ?int $assignedMemberId = null, + ?string $actorRef = null, + ): InvestigationRequest { + $this->assertStatus($request, InvestigationRequest::STATUS_SAMPLE_COLLECTED); + + $request->update([ + 'status' => InvestigationRequest::STATUS_IN_PROGRESS, + 'assigned_member_id' => $assignedMemberId, + ]); + + InvestigationResult::firstOrCreate( + ['investigation_request_id' => $request->id], + ['owner_ref' => $ownerRef, 'entered_by' => $actorRef, 'status' => InvestigationResult::STATUS_DRAFT], + ); + + AuditLogger::record($ownerRef, 'investigation.in_progress', $request->organization_id, $actorRef, InvestigationRequest::class, $request->id); + + return $request->fresh(['patient', 'investigationType', 'result']); + } + + /** + * @param array $data + */ + public function enterResults( + InvestigationRequest $request, + string $ownerRef, + array $data, + ?string $actorRef = null, + ): InvestigationResult { + if (! in_array($request->status, [InvestigationRequest::STATUS_IN_PROGRESS, InvestigationRequest::STATUS_AWAITING_REVIEW], true)) { + throw new InvalidArgumentException('Results can only be entered when processing.'); + } + + $result = InvestigationResult::firstOrCreate( + ['investigation_request_id' => $request->id], + ['owner_ref' => $ownerRef, 'entered_by' => $actorRef], + ); + + $type = $request->investigationType; + $isAbnormal = false; + + if (! empty($data['values']) && is_array($data['values'])) { + $result->values()->delete(); + foreach ($data['values'] as $row) { + if (empty($row['parameter'])) { + continue; + } + $abnormal = $this->isValueAbnormal( + $row['value'] ?? null, + $row['reference_low'] ?? $type->reference_low, + $row['reference_high'] ?? $type->reference_high, + ); + $isAbnormal = $isAbnormal || $abnormal; + + InvestigationResultValue::create([ + 'owner_ref' => $ownerRef, + 'investigation_result_id' => $result->id, + 'parameter' => $row['parameter'], + 'value' => $row['value'] ?? null, + 'unit' => $row['unit'] ?? $type->unit, + 'reference_low' => $row['reference_low'] ?? $type->reference_low, + 'reference_high' => $row['reference_high'] ?? $type->reference_high, + 'reference_text' => $row['reference_text'] ?? $type->reference_text, + 'is_abnormal' => $abnormal, + ]); + } + } elseif (! empty($data['value'])) { + $result->values()->delete(); + $abnormal = $this->isValueAbnormal($data['value'], $type->reference_low, $type->reference_high); + $isAbnormal = $abnormal; + InvestigationResultValue::create([ + 'owner_ref' => $ownerRef, + 'investigation_result_id' => $result->id, + 'parameter' => $type->name, + 'value' => $data['value'], + 'unit' => $type->unit, + 'reference_low' => $type->reference_low, + 'reference_high' => $type->reference_high, + 'reference_text' => $type->reference_text, + 'is_abnormal' => $abnormal, + ]); + } + + $result->update([ + 'result_summary' => $data['result_summary'] ?? $result->result_summary, + 'interpretation' => $data['interpretation'] ?? $result->interpretation, + 'is_abnormal' => $isAbnormal, + 'entered_by' => $actorRef ?? $result->entered_by, + 'status' => InvestigationResult::STATUS_DRAFT, + ]); + + if (! empty($data['attachments'])) { + $this->storeAttachments($result, $ownerRef, $data['attachments'], $actorRef); + } + + $request->update(['status' => InvestigationRequest::STATUS_AWAITING_REVIEW]); + + AuditLogger::record($ownerRef, 'investigation.results_entered', $request->organization_id, $actorRef, InvestigationResult::class, $result->id); + + return $result->fresh(['values', 'attachments']); + } + + public function approve(InvestigationRequest $request, string $ownerRef, ?string $actorRef = null): InvestigationRequest + { + $this->assertStatus($request, InvestigationRequest::STATUS_AWAITING_REVIEW); + + $result = $request->result; + abort_unless($result, 422, 'No results to approve.'); + + $result->update([ + 'status' => InvestigationResult::STATUS_APPROVED, + 'approved_by' => $actorRef, + 'approved_at' => now(), + ]); + + $request->update([ + 'status' => InvestigationRequest::STATUS_COMPLETED, + 'completed_at' => now(), + 'approved_by' => $actorRef, + 'approved_at' => now(), + ]); + + AuditLogger::record($ownerRef, 'investigation.approved', $request->organization_id, $actorRef, InvestigationRequest::class, $request->id); + + return $request->fresh(['patient', 'investigationType', 'result.values']); + } + + public function deliver(InvestigationRequest $request, string $ownerRef, ?string $actorRef = null): InvestigationRequest + { + $this->assertStatus($request, InvestigationRequest::STATUS_COMPLETED); + + $request->update([ + 'status' => InvestigationRequest::STATUS_DELIVERED, + 'delivered_at' => now(), + ]); + + AuditLogger::record($ownerRef, 'investigation.delivered', $request->organization_id, $actorRef, InvestigationRequest::class, $request->id); + + return $request->fresh(['patient', 'investigationType', 'result']); + } + + public function cancel(InvestigationRequest $request, string $ownerRef, ?string $actorRef = null): InvestigationRequest + { + if (in_array($request->status, [InvestigationRequest::STATUS_COMPLETED, InvestigationRequest::STATUS_DELIVERED], true)) { + throw new InvalidArgumentException('Cannot cancel a completed investigation.'); + } + + $request->update(['status' => InvestigationRequest::STATUS_CANCELLED]); + AuditLogger::record($ownerRef, 'investigation.cancelled', $request->organization_id, $actorRef, InvestigationRequest::class, $request->id); + + return $request->fresh(); + } + + /** + * @param array $data + */ + public function createType(Organization $organization, string $ownerRef, array $data): InvestigationType + { + $type = InvestigationType::create([ + 'owner_ref' => $ownerRef, + 'organization_id' => $organization->id, + 'name' => $data['name'], + 'code' => $data['code'] ?? null, + 'category' => $data['category'], + 'description' => $data['description'] ?? null, + 'unit' => $data['unit'] ?? null, + 'reference_low' => $data['reference_low'] ?? null, + 'reference_high' => $data['reference_high'] ?? null, + 'reference_text' => $data['reference_text'] ?? null, + 'price_minor' => (int) ($data['price_minor'] ?? 0), + 'is_active' => (bool) ($data['is_active'] ?? true), + ]); + + AuditLogger::record($ownerRef, 'investigation_type.created', $organization->id, null, InvestigationType::class, $type->id); + + return $type; + } + + /** + * @param array $data + */ + public function updateType(InvestigationType $type, string $ownerRef, array $data): InvestigationType + { + $type->update([ + 'name' => $data['name'], + 'code' => $data['code'] ?? null, + 'category' => $data['category'], + 'description' => $data['description'] ?? null, + 'unit' => $data['unit'] ?? null, + 'reference_low' => $data['reference_low'] ?? null, + 'reference_high' => $data['reference_high'] ?? null, + 'reference_text' => $data['reference_text'] ?? null, + 'price_minor' => (int) ($data['price_minor'] ?? 0), + 'is_active' => (bool) ($data['is_active'] ?? true), + ]); + + AuditLogger::record($ownerRef, 'investigation_type.updated', $type->organization_id, null, InvestigationType::class, $type->id); + + return $type; + } + + protected function assertStatus(InvestigationRequest $request, string ...$allowed): void + { + if (! in_array($request->status, $allowed, true)) { + throw new InvalidArgumentException("Cannot transition from {$request->status}."); + } + } + + protected function isValueAbnormal(?string $value, mixed $low, mixed $high): bool + { + if ($value === null || $value === '') { + return false; + } + + if (! is_numeric($value)) { + return false; + } + + $numeric = (float) $value; + + if ($low !== null && $numeric < (float) $low) { + return true; + } + + if ($high !== null && $numeric > (float) $high) { + return true; + } + + return false; + } + + protected function generateBarcode(InvestigationRequest $request): string + { + return 'LAB-'.str_pad((string) $request->id, 6, '0', STR_PAD_LEFT); + } + + /** + * @param array $files + */ + protected function storeAttachments(InvestigationResult $result, string $ownerRef, array $files, ?string $actorRef): void + { + foreach ($files as $file) { + if (! $file instanceof UploadedFile) { + continue; + } + + $path = $file->store("care/investigations/{$result->id}/attachments", 'public'); + + InvestigationAttachment::create([ + 'owner_ref' => $ownerRef, + 'investigation_result_id' => $result->id, + 'file_path' => $path, + 'original_name' => $file->getClientOriginalName(), + 'mime_type' => $file->getMimeType(), + 'uploaded_by' => $actorRef, + ]); + } + } +} diff --git a/app/Services/Care/InvoiceNumberGenerator.php b/app/Services/Care/InvoiceNumberGenerator.php new file mode 100644 index 0000000..c27ac3b --- /dev/null +++ b/app/Services/Care/InvoiceNumberGenerator.php @@ -0,0 +1,32 @@ +format('Y'); + + return DB::transaction(function () use ($organization, $prefix, $year) { + $latest = Bill::withTrashed() + ->where('organization_id', $organization->id) + ->where('invoice_number', 'like', "{$prefix}-{$year}-%") + ->orderByDesc('invoice_number') + ->lockForUpdate() + ->value('invoice_number'); + + $sequence = 1; + if ($latest && preg_match('/-(\d+)$/', $latest, $matches)) { + $sequence = (int) $matches[1] + 1; + } + + return sprintf('%s-%s-%05d', $prefix, $year, $sequence); + }); + } +} diff --git a/app/Services/Care/OrganizationResolver.php b/app/Services/Care/OrganizationResolver.php new file mode 100644 index 0000000..b07fc28 --- /dev/null +++ b/app/Services/Care/OrganizationResolver.php @@ -0,0 +1,122 @@ +ownerRef(); + + $member = Member::where('user_ref', $ref)->first(); + if ($member) { + return Organization::find($member->organization_id); + } + + return Organization::owned($ref)->first(); + } + + public function forUser(User $user): Organization + { + return $this->resolveForUser($user) + ?? throw new \RuntimeException('No organization for user.'); + } + + public function isOnboarded(User $user): bool + { + $organization = $this->resolveForUser($user); + + return $organization !== null + && (bool) data_get($organization->settings, 'onboarded', false); + } + + public function memberFor(User $user, ?Organization $organization = null): ?Member + { + $organization ??= $this->resolveForUser($user); + if (! $organization) { + return null; + } + + return Member::where('organization_id', $organization->id) + ->where('user_ref', $user->ownerRef()) + ->first(); + } + + public function ensureOwnerMember(User $user, Organization $organization): Member + { + return Member::firstOrCreate( + [ + 'organization_id' => $organization->id, + 'user_ref' => $user->ownerRef(), + ], + [ + 'owner_ref' => $user->ownerRef(), + 'role' => 'hospital_admin', + ], + ); + } + + /** + * @param array $data + */ + public function completeOnboarding(User $user, array $data): Organization + { + $ref = $user->ownerRef(); + + $organization = Organization::create([ + 'owner_ref' => $ref, + 'name' => $data['organization_name'], + 'slug' => Str::slug($data['organization_name']).'-'.substr($ref, 0, 6), + 'timezone' => $data['timezone'] ?? config('app.timezone', 'UTC'), + 'settings' => [ + 'onboarded' => true, + 'facility_type' => $data['facility_type'] ?? 'clinic', + ], + ]); + + $this->ensureOwnerMember($user, $organization); + + $branch = Branch::create([ + 'owner_ref' => $ref, + 'organization_id' => $organization->id, + 'name' => $data['branch_name'], + 'address' => $data['branch_address'] ?? null, + 'phone' => $data['branch_phone'] ?? null, + 'is_active' => true, + ]); + + Department::create([ + 'owner_ref' => $ref, + 'branch_id' => $branch->id, + 'name' => 'General Outpatient', + 'type' => 'outpatient', + 'is_active' => true, + ]); + + AuditLogger::record($ref, 'organization.created', $organization->id, $ref, Organization::class, $organization->id); + AuditLogger::record($ref, 'branch.created', $organization->id, $ref, Branch::class, $branch->id); + + return $organization; + } + + /** Branch ID the member may access; null = all branches. */ + public function branchScope(?Member $member): ?int + { + if ($member === null) { + return null; + } + + if (in_array($member->role, ['super_admin', 'hospital_admin', 'accountant'], true)) { + return null; + } + + return $member->branch_id; + } +} diff --git a/app/Services/Care/PatientNumberGenerator.php b/app/Services/Care/PatientNumberGenerator.php new file mode 100644 index 0000000..b23d5ae --- /dev/null +++ b/app/Services/Care/PatientNumberGenerator.php @@ -0,0 +1,32 @@ +format('Y'); + + return DB::transaction(function () use ($organization, $prefix, $year) { + $latest = Patient::withTrashed() + ->where('organization_id', $organization->id) + ->where('patient_number', 'like', "{$prefix}-{$year}-%") + ->orderByDesc('patient_number') + ->lockForUpdate() + ->value('patient_number'); + + $sequence = 1; + if ($latest && preg_match('/-(\d+)$/', $latest, $matches)) { + $sequence = (int) $matches[1] + 1; + } + + return sprintf('%s-%s-%05d', $prefix, $year, $sequence); + }); + } +} diff --git a/app/Services/Care/PatientService.php b/app/Services/Care/PatientService.php new file mode 100644 index 0000000..6cc6db8 --- /dev/null +++ b/app/Services/Care/PatientService.php @@ -0,0 +1,324 @@ +where('organization_id', $organizationId); + } + + /** + * @param array $filters + */ + public function search(string $ownerRef, int $organizationId, array $filters = [], ?int $branchId = null): LengthAwarePaginator + { + $query = $this->queryForOrganization($ownerRef, $organizationId) + ->with(['branch']) + ->orderByDesc('created_at'); + + if ($branchId !== null) { + $query->where('branch_id', $branchId); + } + + if ($q = trim((string) ($filters['q'] ?? ''))) { + $query->where(function (Builder $inner) use ($q) { + $inner->where('patient_number', 'like', "%{$q}%") + ->orWhere('phone', 'like', "%{$q}%") + ->orWhere('national_id', 'like', "%{$q}%") + ->orWhere('first_name', 'like', "%{$q}%") + ->orWhere('last_name', 'like', "%{$q}%") + ->orWhere('other_names', 'like', "%{$q}%") + ->orWhereRaw("concat(first_name, ' ', coalesce(other_names, ''), ' ', last_name) like ?", ["%{$q}%"]); + }); + } + + if ($patientNumber = trim((string) ($filters['patient_number'] ?? ''))) { + $query->where('patient_number', $patientNumber); + } + + if ($phone = trim((string) ($filters['phone'] ?? ''))) { + $query->where('phone', 'like', "%{$phone}%"); + } + + if ($nationalId = trim((string) ($filters['national_id'] ?? ''))) { + $query->where('national_id', $nationalId); + } + + if ($dob = $filters['date_of_birth'] ?? null) { + $query->whereDate('date_of_birth', Carbon::parse($dob)->toDateString()); + } + + return $query->paginate((int) ($filters['per_page'] ?? 20))->withQueryString(); + } + + /** + * @param array $data + */ + public function create(Organization $organization, string $ownerRef, array $data, ?string $actorRef = null): Patient + { + $patient = Patient::create([ + 'owner_ref' => $ownerRef, + 'organization_id' => $organization->id, + 'branch_id' => $data['branch_id'] ?? null, + 'patient_number' => $this->numbers->generate($organization), + 'first_name' => $data['first_name'], + 'last_name' => $data['last_name'], + 'other_names' => $data['other_names'] ?? null, + 'gender' => $data['gender'] ?? null, + 'date_of_birth' => $data['date_of_birth'] ?? null, + 'phone' => $data['phone'] ?? null, + 'email' => $data['email'] ?? null, + 'national_id' => $data['national_id'] ?? null, + 'address' => $data['address'] ?? null, + 'city' => $data['city'] ?? null, + 'region' => $data['region'] ?? null, + 'notes' => $data['notes'] ?? null, + ]); + + $this->syncRelated($patient, $ownerRef, $data); + $this->storeAttachments($patient, $ownerRef, $data['attachments'] ?? [], $actorRef); + + AuditLogger::record($ownerRef, 'patient.created', $organization->id, $actorRef, Patient::class, $patient->id); + + return $patient->fresh([ + 'allergies', 'conditions', 'familyHistory', 'emergencyContacts', + 'insurancePolicies', 'attachments', 'branch', + ]); + } + + /** + * @param array $data + */ + public function update(Patient $patient, string $ownerRef, array $data, ?string $actorRef = null): Patient + { + $patient->update([ + 'branch_id' => $data['branch_id'] ?? $patient->branch_id, + 'first_name' => $data['first_name'], + 'last_name' => $data['last_name'], + 'other_names' => $data['other_names'] ?? null, + 'gender' => $data['gender'] ?? null, + 'date_of_birth' => $data['date_of_birth'] ?? null, + 'phone' => $data['phone'] ?? null, + 'email' => $data['email'] ?? null, + 'national_id' => $data['national_id'] ?? null, + 'address' => $data['address'] ?? null, + 'city' => $data['city'] ?? null, + 'region' => $data['region'] ?? null, + 'notes' => $data['notes'] ?? null, + ]); + + $this->syncRelated($patient, $ownerRef, $data); + $this->storeAttachments($patient, $ownerRef, $data['attachments'] ?? [], $actorRef); + + AuditLogger::record($ownerRef, 'patient.updated', $patient->organization_id, $actorRef, Patient::class, $patient->id); + + return $patient->fresh([ + 'allergies', 'conditions', 'familyHistory', 'emergencyContacts', + 'insurancePolicies', 'attachments', 'branch', + ]); + } + + public function delete(Patient $patient, string $ownerRef, ?string $actorRef = null): void + { + $organizationId = $patient->organization_id; + $patientId = $patient->id; + + foreach ($patient->attachments as $attachment) { + Storage::disk('public')->delete($attachment->file_path); + } + + $patient->delete(); + + AuditLogger::record($ownerRef, 'patient.deleted', $organizationId, $actorRef, Patient::class, $patientId); + } + + /** + * @return array + */ + public function dashboard(Patient $patient): array + { + $patient->load([ + 'branch', 'allergies', 'conditions', 'familyHistory', + 'emergencyContacts', 'insurancePolicies', 'attachments', + ]); + + $visits = $patient->visits() + ->with(['branch']) + ->orderByDesc('checked_in_at') + ->limit(10) + ->get(); + + $consultations = Consultation::owned($patient->owner_ref) + ->where('patient_id', $patient->id) + ->with(['practitioner', 'diagnoses']) + ->orderByDesc('started_at') + ->limit(10) + ->get(); + + $laboratory = $patient->investigationRequests() + ->with(['investigationType', 'result']) + ->whereIn('status', [ + \App\Models\InvestigationRequest::STATUS_COMPLETED, + \App\Models\InvestigationRequest::STATUS_DELIVERED, + ]) + ->orderByDesc('completed_at') + ->limit(10) + ->get(); + + $prescriptions = $patient->prescriptions() + ->with(['practitioner', 'items']) + ->orderByDesc('created_at') + ->limit(10) + ->get(); + + $invoices = $patient->bills() + ->with(['branch', 'payments']) + ->orderByDesc('created_at') + ->limit(10) + ->get(); + + return [ + 'patient' => $patient, + 'visits' => $visits, + 'consultations' => $consultations, + 'laboratory' => $laboratory, + 'prescriptions' => $prescriptions, + 'invoices' => $invoices, + ]; + } + + /** + * @param array $data + */ + protected function syncRelated(Patient $patient, string $ownerRef, array $data): void + { + if (array_key_exists('allergies', $data)) { + $patient->allergies()->delete(); + foreach ($data['allergies'] as $row) { + if (empty($row['allergen'])) { + continue; + } + PatientAllergy::create([ + 'owner_ref' => $ownerRef, + 'patient_id' => $patient->id, + 'allergen' => $row['allergen'], + 'severity' => $row['severity'] ?? 'unknown', + 'notes' => $row['notes'] ?? null, + ]); + } + } + + if (array_key_exists('conditions', $data)) { + $patient->conditions()->delete(); + foreach ($data['conditions'] as $row) { + if (empty($row['condition'])) { + continue; + } + PatientCondition::create([ + 'owner_ref' => $ownerRef, + 'patient_id' => $patient->id, + 'condition' => $row['condition'], + 'onset_date' => $row['onset_date'] ?? null, + 'is_chronic' => (bool) ($row['is_chronic'] ?? false), + 'notes' => $row['notes'] ?? null, + ]); + } + } + + if (array_key_exists('family_history', $data)) { + $patient->familyHistory()->delete(); + foreach ($data['family_history'] as $row) { + if (empty($row['condition'])) { + continue; + } + PatientFamilyHistory::create([ + 'owner_ref' => $ownerRef, + 'patient_id' => $patient->id, + 'relation' => $row['relation'] ?? 'other', + 'condition' => $row['condition'], + 'notes' => $row['notes'] ?? null, + ]); + } + } + + if (array_key_exists('emergency_contacts', $data)) { + $patient->emergencyContacts()->delete(); + foreach ($data['emergency_contacts'] as $row) { + if (empty($row['name']) || empty($row['phone'])) { + continue; + } + EmergencyContact::create([ + 'owner_ref' => $ownerRef, + 'patient_id' => $patient->id, + 'name' => $row['name'], + 'phone' => $row['phone'], + 'relationship' => $row['relationship'] ?? null, + 'is_primary' => (bool) ($row['is_primary'] ?? false), + ]); + } + } + + if (array_key_exists('insurance', $data)) { + $patient->insurancePolicies()->delete(); + foreach ($data['insurance'] as $row) { + if (empty($row['provider_name'])) { + continue; + } + InsurancePolicy::create([ + 'owner_ref' => $ownerRef, + 'patient_id' => $patient->id, + 'provider_name' => $row['provider_name'], + 'policy_number' => $row['policy_number'] ?? null, + 'coverage_type' => $row['coverage_type'] ?? null, + 'expiry_date' => $row['expiry_date'] ?? null, + 'notes' => $row['notes'] ?? null, + ]); + } + } + } + + /** + * @param array $files + */ + protected function storeAttachments(Patient $patient, string $ownerRef, array $files, ?string $actorRef): void + { + foreach ($files as $file) { + if (! $file instanceof UploadedFile) { + continue; + } + + $path = $file->store("care/patients/{$patient->id}/attachments", 'public'); + + PatientAttachment::create([ + 'owner_ref' => $ownerRef, + 'patient_id' => $patient->id, + 'file_path' => $path, + 'original_name' => $file->getClientOriginalName(), + 'mime_type' => $file->getMimeType(), + 'document_type' => 'other', + 'uploaded_by' => $actorRef, + ]); + } + } +} diff --git a/app/Services/Care/PharmacyService.php b/app/Services/Care/PharmacyService.php new file mode 100644 index 0000000..40a0674 --- /dev/null +++ b/app/Services/Care/PharmacyService.php @@ -0,0 +1,202 @@ +where('organization_id', $organizationId); + } + + /** + * @param array $filters + */ + public function listDrugs(string $ownerRef, int $organizationId, array $filters = [], ?int $branchId = null): LengthAwarePaginator + { + $query = $this->queryDrugs($ownerRef, $organizationId) + ->with(['batches']) + ->orderBy('name'); + + if ($branchId !== null) { + $query->where(function (Builder $q) use ($branchId) { + $q->where('branch_id', $branchId)->orWhereNull('branch_id'); + }); + } + + if ($search = trim((string) ($filters['q'] ?? ''))) { + $query->where(function (Builder $inner) use ($search) { + $inner->where('name', 'like', "%{$search}%") + ->orWhere('generic_name', 'like', "%{$search}%") + ->orWhere('sku', 'like', "%{$search}%"); + }); + } + + return $query->paginate((int) ($filters['per_page'] ?? 30))->withQueryString(); + } + + /** + * @param array $data + */ + public function createDrug(Organization $organization, string $ownerRef, array $data): Drug + { + $drug = Drug::create([ + 'owner_ref' => $ownerRef, + 'organization_id' => $organization->id, + 'branch_id' => $data['branch_id'] ?? null, + 'name' => $data['name'], + 'generic_name' => $data['generic_name'] ?? null, + 'sku' => $data['sku'] ?? null, + 'unit' => $data['unit'] ?? 'unit', + 'unit_price_minor' => (int) ($data['unit_price_minor'] ?? 0), + 'reorder_level' => (int) ($data['reorder_level'] ?? 10), + 'is_active' => (bool) ($data['is_active'] ?? true), + ]); + + AuditLogger::record($ownerRef, 'drug.created', $organization->id, null, Drug::class, $drug->id); + + return $drug; + } + + /** + * @param array $data + */ + public function updateDrug(Drug $drug, string $ownerRef, array $data): Drug + { + $drug->update([ + 'branch_id' => $data['branch_id'] ?? $drug->branch_id, + 'name' => $data['name'], + 'generic_name' => $data['generic_name'] ?? null, + 'sku' => $data['sku'] ?? null, + 'unit' => $data['unit'] ?? $drug->unit, + 'unit_price_minor' => (int) ($data['unit_price_minor'] ?? 0), + 'reorder_level' => (int) ($data['reorder_level'] ?? 10), + 'is_active' => (bool) ($data['is_active'] ?? true), + ]); + + AuditLogger::record($ownerRef, 'drug.updated', $drug->organization_id, null, Drug::class, $drug->id); + + return $drug->fresh(['batches']); + } + + /** + * @param array $data + */ + public function receiveBatch(Drug $drug, string $ownerRef, array $data, ?string $actorRef = null): DrugBatch + { + $batch = DrugBatch::create([ + 'owner_ref' => $ownerRef, + 'drug_id' => $drug->id, + 'batch_number' => $data['batch_number'], + 'expiry_date' => $data['expiry_date'] ?? null, + 'quantity_on_hand' => (int) ($data['quantity_on_hand'] ?? 0), + 'cost_minor' => (int) ($data['cost_minor'] ?? 0), + 'received_at' => now(), + ]); + + AuditLogger::record($ownerRef, 'drug.batch_received', $drug->organization_id, $actorRef, DrugBatch::class, $batch->id); + + return $batch->load('drug'); + } + + /** + * @return Collection + */ + public function lowStock(string $ownerRef, int $organizationId): Collection + { + return $this->queryDrugs($ownerRef, $organizationId) + ->where('is_active', true) + ->with('batches') + ->get() + ->filter(fn (Drug $drug) => $drug->stockOnHand() <= $drug->reorder_level); + } + + /** + * @return Collection + */ + public function expiredBatches(string $ownerRef, int $organizationId): Collection + { + return DrugBatch::owned($ownerRef) + ->whereHas('drug', fn (Builder $q) => $q->where('organization_id', $organizationId)) + ->whereNotNull('expiry_date') + ->where('expiry_date', '<', now()->toDateString()) + ->where('quantity_on_hand', '>', 0) + ->with('drug') + ->get(); + } + + /** + * @param array> $allocations + */ + public function dispensePrescription( + Prescription $prescription, + string $ownerRef, + array $allocations, + ?string $actorRef = null, + ): Prescription { + if ($prescription->status !== Prescription::STATUS_ACTIVE) { + throw new InvalidArgumentException('Only active prescriptions can be dispensed.'); + } + + $prescription->load('items'); + + foreach ($allocations as $row) { + if (empty($row['prescription_item_id']) || empty($row['drug_batch_id'])) { + continue; + } + + $item = $prescription->items->firstWhere('id', (int) $row['prescription_item_id']); + if (! $item || $item->is_procedure) { + continue; + } + + $qty = max(1, (int) ($row['quantity'] ?? 1)); + $batch = DrugBatch::owned($ownerRef)->findOrFail((int) $row['drug_batch_id']); + + if ($batch->isExpired()) { + throw new InvalidArgumentException("Batch {$batch->batch_number} is expired."); + } + + if ($batch->quantity_on_hand < $qty) { + throw new InvalidArgumentException("Insufficient stock for {$batch->drug->name}."); + } + + $batch->decrement('quantity_on_hand', $qty); + + DispensingRecord::create([ + 'owner_ref' => $ownerRef, + 'prescription_id' => $prescription->id, + 'prescription_item_id' => $item->id, + 'drug_batch_id' => $batch->id, + 'quantity' => $qty, + 'dispensed_by' => $actorRef, + 'dispensed_at' => now(), + ]); + + if (! $item->drug_id) { + $item->update(['drug_id' => $batch->drug_id]); + } + } + + $prescription->update([ + 'status' => Prescription::STATUS_DISPENSED, + 'dispensed_at' => now(), + 'dispensed_by' => $actorRef, + ]); + + AuditLogger::record($ownerRef, 'prescription.dispensed', $prescription->organization_id, $actorRef, Prescription::class, $prescription->id); + + return $prescription->fresh(['items', 'patient']); + } +} diff --git a/app/Services/Care/PlanService.php b/app/Services/Care/PlanService.php new file mode 100644 index 0000000..407feed --- /dev/null +++ b/app/Services/Care/PlanService.php @@ -0,0 +1,37 @@ +settings, 'plan', 'free'); + } + + public function isPro(Organization $organization): bool + { + return $this->plan($organization) === 'pro'; + } + + public function maxBranches(Organization $organization): ?int + { + $plan = config('care.plans.'.$this->plan($organization)); + + return $plan['max_branches'] ?? null; + } + + public function canAddBranch(Organization $organization, int $currentCount): bool + { + $max = $this->maxBranches($organization); + + return $max === null || $currentCount < $max; + } + + public function proPriceMinor(): int + { + return (int) config('care.plans.pro.price_minor', 15000); + } +} diff --git a/app/Services/Care/PrescriptionService.php b/app/Services/Care/PrescriptionService.php new file mode 100644 index 0000000..3cfaa26 --- /dev/null +++ b/app/Services/Care/PrescriptionService.php @@ -0,0 +1,189 @@ +where('organization_id', $organizationId); + } + + /** + * @param array $filters + */ + public function list(string $ownerRef, int $organizationId, array $filters = [], ?int $branchId = null): LengthAwarePaginator + { + $query = $this->queryForOrganization($ownerRef, $organizationId) + ->with(['patient', 'practitioner', 'items']) + ->orderByDesc('created_at'); + + if ($status = $filters['status'] ?? null) { + $query->where('status', $status); + } + + if ($patientId = $filters['patient_id'] ?? null) { + $query->where('patient_id', $patientId); + } + + if ($branchId !== null) { + $query->whereHas('visit', fn (Builder $q) => $q->where('branch_id', $branchId)); + } + + return $query->paginate((int) ($filters['per_page'] ?? 20))->withQueryString(); + } + + /** + * @return Collection + */ + public function pharmacyQueue(string $ownerRef, int $organizationId): Collection + { + return $this->queryForOrganization($ownerRef, $organizationId) + ->where('status', Prescription::STATUS_ACTIVE) + ->with(['patient', 'practitioner', 'items', 'visit.branch']) + ->orderBy('created_at') + ->get(); + } + + /** + * @param array $data + */ + public function createFromConsultation( + Consultation $consultation, + string $ownerRef, + array $data, + ?string $actorRef = null, + ): Prescription { + $consultation->loadMissing('visit'); + + $status = ($data['activate'] ?? true) ? Prescription::STATUS_ACTIVE : Prescription::STATUS_DRAFT; + + $prescription = Prescription::create([ + 'owner_ref' => $ownerRef, + 'organization_id' => $consultation->visit->organization_id, + 'visit_id' => $consultation->visit_id, + 'consultation_id' => $consultation->id, + 'patient_id' => $consultation->patient_id, + 'practitioner_id' => $data['practitioner_id'] ?? $consultation->practitioner_id, + 'status' => $status, + 'notes' => $data['notes'] ?? null, + 'prescribed_by' => $actorRef, + ]); + + $this->syncItems($prescription, $ownerRef, $data['items'] ?? []); + + AuditLogger::record( + $ownerRef, + 'prescription.created', + $consultation->visit->organization_id, + $actorRef, + Prescription::class, + $prescription->id, + ); + + return $prescription->fresh(['items', 'patient', 'practitioner']); + } + + /** + * @param array $data + */ + public function update(Prescription $prescription, string $ownerRef, array $data, ?string $actorRef = null): Prescription + { + if ($prescription->status !== Prescription::STATUS_DRAFT) { + throw new InvalidArgumentException('Only draft prescriptions can be edited.'); + } + + $prescription->update([ + 'practitioner_id' => $data['practitioner_id'] ?? $prescription->practitioner_id, + 'notes' => $data['notes'] ?? $prescription->notes, + ]); + + if (array_key_exists('items', $data)) { + $this->syncItems($prescription, $ownerRef, $data['items']); + } + + AuditLogger::record($ownerRef, 'prescription.updated', $prescription->organization_id, $actorRef, Prescription::class, $prescription->id); + + return $prescription->fresh(['items', 'patient', 'practitioner']); + } + + public function activate(Prescription $prescription, string $ownerRef, ?string $actorRef = null): Prescription + { + $this->assertStatus($prescription, Prescription::STATUS_DRAFT); + + $prescription->update(['status' => Prescription::STATUS_ACTIVE]); + AuditLogger::record($ownerRef, 'prescription.activated', $prescription->organization_id, $actorRef, Prescription::class, $prescription->id); + + return $prescription->fresh(['items', 'patient']); + } + + public function dispense(Prescription $prescription, string $ownerRef, ?string $actorRef = null): Prescription + { + $this->assertStatus($prescription, Prescription::STATUS_ACTIVE); + + $prescription->update([ + 'status' => Prescription::STATUS_DISPENSED, + 'dispensed_at' => now(), + 'dispensed_by' => $actorRef, + ]); + + AuditLogger::record($ownerRef, 'prescription.dispensed', $prescription->organization_id, $actorRef, Prescription::class, $prescription->id); + + return $prescription->fresh(['items', 'patient']); + } + + public function cancel(Prescription $prescription, string $ownerRef, ?string $actorRef = null): Prescription + { + if (in_array($prescription->status, [Prescription::STATUS_DISPENSED, Prescription::STATUS_CANCELLED], true)) { + throw new InvalidArgumentException('Prescription cannot be cancelled.'); + } + + $prescription->update(['status' => Prescription::STATUS_CANCELLED]); + AuditLogger::record($ownerRef, 'prescription.cancelled', $prescription->organization_id, $actorRef, Prescription::class, $prescription->id); + + return $prescription->fresh(['items', 'patient']); + } + + /** + * @param array> $items + */ + protected function syncItems(Prescription $prescription, string $ownerRef, array $items): void + { + $prescription->items()->delete(); + + foreach ($items as $index => $row) { + if (empty($row['name'])) { + continue; + } + + PrescriptionItem::create([ + 'owner_ref' => $ownerRef, + 'prescription_id' => $prescription->id, + 'is_procedure' => (bool) ($row['is_procedure'] ?? false), + 'name' => $row['name'], + 'dosage' => $row['dosage'] ?? null, + 'frequency' => $row['frequency'] ?? null, + 'duration' => $row['duration'] ?? null, + 'route' => $row['route'] ?? null, + 'quantity' => $row['quantity'] ?? null, + 'instructions' => $row['instructions'] ?? null, + 'sort_order' => $index, + ]); + } + } + + protected function assertStatus(Prescription $prescription, string ...$allowed): void + { + if (! in_array($prescription->status, $allowed, true)) { + throw new InvalidArgumentException("Cannot transition from {$prescription->status}."); + } + } +} diff --git a/app/Services/Care/ReportService.php b/app/Services/Care/ReportService.php new file mode 100644 index 0000000..2d8fdc8 --- /dev/null +++ b/app/Services/Care/ReportService.php @@ -0,0 +1,193 @@ + + */ + public function dashboardStats(string $ownerRef, int $organizationId, ?int $branchId = null): array + { + $today = now()->startOfDay(); + + $patientsToday = Patient::owned($ownerRef) + ->where('organization_id', $organizationId) + ->when($branchId, fn ($q) => $q->where('branch_id', $branchId)) + ->whereDate('created_at', $today) + ->count(); + + $appointmentsToday = Appointment::owned($ownerRef) + ->where('organization_id', $organizationId) + ->when($branchId, fn ($q) => $q->where('branch_id', $branchId)) + ->whereDate('scheduled_at', $today) + ->count(); + + $openBills = Bill::owned($ownerRef) + ->where('organization_id', $organizationId) + ->when($branchId, fn ($q) => $q->where('branch_id', $branchId)) + ->whereIn('status', [Bill::STATUS_OPEN, Bill::STATUS_PARTIAL]) + ->count(); + + $revenueToday = Payment::owned($ownerRef) + ->whereHas('bill', function (Builder $q) use ($organizationId, $branchId) { + $q->where('organization_id', $organizationId); + if ($branchId) { + $q->where('branch_id', $branchId); + } + }) + ->whereDate('paid_at', $today) + ->sum('amount_minor'); + + $pendingLab = InvestigationRequest::owned($ownerRef) + ->where('organization_id', $organizationId) + ->when($branchId, fn ($q) => $q->where('branch_id', $branchId)) + ->whereIn('status', InvestigationRequest::activeStatuses()) + ->count(); + + return [ + 'patients_today' => $patientsToday, + 'appointments_today' => $appointmentsToday, + 'open_bills' => $openBills, + 'revenue_today_minor' => (int) $revenueToday, + 'pending_lab' => $pendingLab, + ]; + } + + /** + * @return array + */ + public function patientsReport(string $ownerRef, int $organizationId, Carbon $from, Carbon $to, ?int $branchId = null): array + { + $newPatients = Patient::owned($ownerRef) + ->where('organization_id', $organizationId) + ->when($branchId, fn ($q) => $q->where('branch_id', $branchId)) + ->whereBetween('created_at', [$from, $to]) + ->count(); + + $returningPatients = Visit::owned($ownerRef) + ->where('organization_id', $organizationId) + ->when($branchId, fn ($q) => $q->where('branch_id', $branchId)) + ->whereBetween('checked_in_at', [$from, $to]) + ->distinct('patient_id') + ->count('patient_id'); + + $visits = Visit::owned($ownerRef) + ->where('organization_id', $organizationId) + ->when($branchId, fn ($q) => $q->where('branch_id', $branchId)) + ->whereBetween('checked_in_at', [$from, $to]) + ->count(); + + return [ + 'new_patients' => $newPatients, + 'returning_patients' => $returningPatients, + 'total_visits' => $visits, + ]; + } + + /** + * @return array + */ + public function appointmentsReport(string $ownerRef, int $organizationId, Carbon $from, Carbon $to, ?int $branchId = null): array + { + $base = Appointment::owned($ownerRef) + ->where('organization_id', $organizationId) + ->when($branchId, fn ($q) => $q->where('branch_id', $branchId)) + ->whereBetween('scheduled_at', [$from, $to]); + + return [ + 'total' => (clone $base)->count(), + 'completed' => (clone $base)->where('status', Appointment::STATUS_COMPLETED)->count(), + 'cancelled' => (clone $base)->where('status', Appointment::STATUS_CANCELLED)->count(), + 'no_show' => (clone $base)->where('status', Appointment::STATUS_NO_SHOW)->count(), + ]; + } + + /** + * @return array + */ + public function laboratoryReport(string $ownerRef, int $organizationId, Carbon $from, Carbon $to, ?int $branchId = null): array + { + $base = InvestigationRequest::owned($ownerRef) + ->where('organization_id', $organizationId) + ->when($branchId, fn ($q) => $q->where('branch_id', $branchId)) + ->whereBetween('created_at', [$from, $to]); + + $completed = (clone $base) + ->whereIn('status', [InvestigationRequest::STATUS_COMPLETED, InvestigationRequest::STATUS_DELIVERED]) + ->get(); + + $turnaroundHours = $completed + ->filter(fn ($r) => $r->completed_at && $r->created_at) + ->map(fn ($r) => $r->created_at->diffInHours($r->completed_at)) + ->avg(); + + return [ + 'requested' => (clone $base)->count(), + 'completed' => $completed->count(), + 'pending' => (clone $base)->whereIn('status', InvestigationRequest::activeStatuses())->count(), + 'avg_turnaround_hours' => $turnaroundHours ? round($turnaroundHours, 1) : null, + ]; + } + + /** + * @return array + */ + public function financeReport(string $ownerRef, int $organizationId, Carbon $from, Carbon $to, ?int $branchId = null): array + { + $billed = Bill::owned($ownerRef) + ->where('organization_id', $organizationId) + ->when($branchId, fn ($q) => $q->where('branch_id', $branchId)) + ->whereBetween('created_at', [$from, $to]) + ->where('status', '!=', Bill::STATUS_VOID); + + $payments = Payment::owned($ownerRef) + ->whereHas('bill', function (Builder $q) use ($organizationId, $branchId) { + $q->where('organization_id', $organizationId); + if ($branchId) { + $q->where('branch_id', $branchId); + } + }) + ->whereBetween('paid_at', [$from, $to]); + + return [ + 'invoiced_minor' => (int) (clone $billed)->sum('total_minor'), + 'collected_minor' => (int) (clone $payments)->sum('amount_minor'), + 'outstanding_minor' => (int) Bill::owned($ownerRef) + ->where('organization_id', $organizationId) + ->when($branchId, fn ($q) => $q->where('branch_id', $branchId)) + ->whereIn('status', [Bill::STATUS_OPEN, Bill::STATUS_PARTIAL]) + ->sum('balance_minor'), + 'invoice_count' => (clone $billed)->count(), + ]; + } + + /** + * @return Collection + */ + public function clinicalReport(string $ownerRef, int $organizationId, Carbon $from, Carbon $to): Collection + { + return Diagnosis::owned($ownerRef) + ->whereHas('consultation.visit', function (Builder $q) use ($organizationId, $from, $to) { + $q->where('organization_id', $organizationId) + ->whereBetween('checked_in_at', [$from, $to]); + }) + ->select('description', DB::raw('count(*) as total')) + ->groupBy('description') + ->orderByDesc('total') + ->limit(20) + ->get(); + } +} diff --git a/app/Services/Care/VisitService.php b/app/Services/Care/VisitService.php new file mode 100644 index 0000000..524e686 --- /dev/null +++ b/app/Services/Care/VisitService.php @@ -0,0 +1,44 @@ + $ownerRef, + 'organization_id' => $organization->id, + 'branch_id' => $branchId, + 'patient_id' => $patient->id, + 'status' => Visit::STATUS_OPEN, + 'checked_in_at' => now(), + 'checked_in_by' => $actorRef, + ]); + + AuditLogger::record($ownerRef, 'visit.checked_in', $organization->id, $actorRef, Visit::class, $visit->id); + + return $visit; + } + + public function complete(Visit $visit, string $ownerRef, ?string $actorRef = null): Visit + { + $visit->update([ + 'status' => Visit::STATUS_COMPLETED, + 'completed_at' => now(), + ]); + + AuditLogger::record($ownerRef, 'visit.completed', $visit->organization_id, $actorRef, Visit::class, $visit->id); + + return $visit; + } +} diff --git a/app/Services/Comms/EmailService.php b/app/Services/Comms/EmailService.php new file mode 100644 index 0000000..bf33e0b --- /dev/null +++ b/app/Services/Comms/EmailService.php @@ -0,0 +1,32 @@ +send(new ContactMessageMail($subject, $body, $fromName, $replyTo)); + + return true; + } catch (\Throwable $e) { + Log::warning('CRM email send failed', ['to' => $to, 'error' => $e->getMessage()]); + + return false; + } + } +} diff --git a/app/Services/Comms/SmsService.php b/app/Services/Comms/SmsService.php new file mode 100644 index 0000000..4bea672 --- /dev/null +++ b/app/Services/Comms/SmsService.php @@ -0,0 +1,67 @@ +normalise($to); + if ($apiKey === '' || $msisdn === null) { + return false; + } + + try { + $res = Http::timeout(20) + ->withHeaders(['api-key' => $apiKey]) + ->acceptJson() + ->post(rtrim((string) config('arkesel.base_url', 'https://sms.arkesel.com'), '/').'/api/v2/sms/send', [ + 'sender' => $sender, + 'message' => $message, + 'recipients' => [$msisdn], + ]); + + return $res->successful() && ($res->json('status') === 'success'); + } catch (\Throwable $e) { + Log::warning('CRM SMS send failed', ['to' => $msisdn, 'error' => $e->getMessage()]); + + return false; + } + } + + /** Normalise to E.164-without-plus (e.g. 233XXXXXXXXX). */ + private function normalise(string $to): ?string + { + $digits = preg_replace('/\D+/', '', $to) ?? ''; + $country = (string) config('arkesel.default_country_code', '233'); + + if (strlen($digits) < 9) { + return null; + } + + if (str_starts_with($digits, $country)) { + return $digits; + } + + if (str_starts_with($digits, '0')) { + return $country.substr($digits, 1); + } + + if (strlen($digits) === 9) { + return $country.$digits; + } + + return $digits; + } +} diff --git a/app/Services/CrossApp/CrossAppLinkService.php b/app/Services/CrossApp/CrossAppLinkService.php new file mode 100644 index 0000000..02ff916 --- /dev/null +++ b/app/Services/CrossApp/CrossAppLinkService.php @@ -0,0 +1,112 @@ +loadMissing(['customer', 'lines']); + + $customer = $deal->customer; + $lines = $deal->lines->map(fn ($line) => [ + 'description' => $line->description, + 'quantity' => (float) $line->quantity, + 'unit_price' => number_format($line->unit_price_minor / 100, 2, '.', ''), + ])->values()->all(); + + if ($lines === [] && (int) $deal->value_minor > 0) { + $lines = [[ + 'description' => $deal->title, + 'quantity' => 1, + 'unit_price' => number_format($deal->value_minor / 100, 2, '.', ''), + ]]; + } + + $prefill = CrmPrefillCodec::encode([ + 'kind' => 'invoice', + 'crm_customer_id' => $customer?->id, + 'client_name' => $customer?->name ?: $deal->title, + 'client_email' => $customer?->email, + 'client_address' => $customer ? $this->formatAddress($customer) : null, + 'notes' => 'Invoice for CRM deal: '.$deal->title, + 'payment_enabled' => true, + 'lines' => $lines, + ]); + + return LadillAppUrl::connect('invoice', '/invoices/create?prefill='.urlencode($prefill)); + } + + public function merchantStorefrontFromDeal(Deal $deal): string + { + $deal->loadMissing('customer'); + + $amount = number_format(((int) $deal->value_minor) / 100, 2, '.', ''); + $itemName = $deal->title; + + $prefill = CrmPrefillCodec::encode([ + 'kind' => 'merchant_storefront', + 'type' => 'shop', + 'label' => 'Payment — '.$deal->title, + 'shop_title' => $deal->customer?->company ?: $deal->title, + 'sections' => [[ + 'name' => 'Payment', + 'items' => [[ + 'name' => $itemName, + 'description' => $deal->notes ?: 'Payment for '.$deal->title, + 'price' => $amount, + 'image_path' => '', + ]], + ]], + 'accepts_payment' => true, + ]); + + return LadillAppUrl::connect('merchant', '/storefronts/create?prefill='.urlencode($prefill)); + } + + public function businessQrFromContact(Customer $contact): string + { + $prefill = CrmPrefillCodec::encode([ + 'kind' => 'qr_business', + 'type' => 'business', + 'label' => 'Card — '.$contact->name, + 'name' => $contact->company ?: $contact->name, + 'phone' => $contact->phone, + 'email' => $contact->email, + 'address' => $this->formatAddress($contact, singleLine: true), + ]); + + return LadillAppUrl::connect('qrplus', '/qr-codes/create?prefill='.urlencode($prefill)); + } + + public function eventsHubForContact(Customer $contact): string + { + $query = http_build_query(array_filter([ + 'search' => $contact->company ?: $contact->name, + ])); + + return LadillAppUrl::connect('events', '/attendees'.($query !== '' ? '?'.$query : '')); + } + + private function formatAddress(Customer $contact, bool $singleLine = false): ?string + { + $parts = array_filter([ + $contact->address_line1, + $contact->address_line2, + trim(implode(', ', array_filter([$contact->city, $contact->region, $contact->country]))), + ]); + + if ($parts === []) { + return null; + } + + return $singleLine + ? implode(', ', $parts) + : implode("\n", $parts); + } +} diff --git a/app/Services/Events/ServiceEventSignature.php b/app/Services/Events/ServiceEventSignature.php new file mode 100644 index 0000000..694ec57 --- /dev/null +++ b/app/Services/Events/ServiceEventSignature.php @@ -0,0 +1,23 @@ +loadMissing('organization'); + + $payload = [ + 'event' => $event, + 'visit' => [ + 'id' => $visit->id, + 'public_id' => $visit->public_id, + 'external_ref' => $visit->external_ref, + 'source' => $visit->source, + 'status' => $visit->status, + 'visitor_type' => $visit->visitor_type, + 'badge_code' => $visit->badge_code, + 'checked_in_at' => $visit->checked_in_at?->toIso8601String(), + 'checked_out_at' => $visit->checked_out_at?->toIso8601String(), + 'visitor_name' => $visit->visitor?->full_name, + 'host_name' => $visit->host?->name, + ], + 'timestamp' => now()->toIso8601String(), + ]; + + $this->dispatchPayload($visit->organization_id, $event, $payload); + } + + public function dispatchEmployee(string $event, Employee $employee, ?EmployeePresence $presence = null): void + { + $presence ??= $employee->presence; + + $payload = [ + 'event' => $event, + 'employee' => [ + 'id' => $employee->id, + 'employee_code' => $employee->employee_code, + 'full_name' => $employee->full_name, + 'department' => $employee->department, + 'branch_id' => $employee->branch_id, + 'status' => $presence?->status, + 'destination' => $presence?->destination, + 'signed_in_at' => $presence?->signed_in_at?->toIso8601String(), + 'expected_return_at' => $presence?->expected_return_at?->toIso8601String(), + ], + 'timestamp' => now()->toIso8601String(), + ]; + + $this->dispatchPayload($employee->organization_id, $event, $payload); + } + + /** @param array $payload */ + protected function dispatchPayload(int $organizationId, string $event, array $payload): void + { + $endpoints = WebhookEndpoint::query() + ->where('organization_id', $organizationId) + ->where('is_active', true) + ->get() + ->filter(fn (WebhookEndpoint $endpoint) => $endpoint->subscribesTo($event)); + + foreach ($endpoints as $endpoint) { + $this->send($endpoint, $payload); + } + } + + /** @param array $payload */ + protected function send(WebhookEndpoint $endpoint, array $payload): void + { + $body = json_encode($payload); + $headers = ['Content-Type' => 'application/json']; + + if ($endpoint->secret) { + $headers['X-Frontdesk-Signature'] = hash_hmac('sha256', $body, $endpoint->secret); + } + + try { + Http::timeout(10)->withHeaders($headers)->withBody($body, 'application/json')->post($endpoint->url); + } catch (\Throwable $e) { + Log::warning('Frontdesk webhook delivery failed', [ + 'endpoint_id' => $endpoint->id, + 'url' => $endpoint->url, + 'error' => $e->getMessage(), + ]); + } + } +} diff --git a/app/Support/LadillAppUrl.php b/app/Support/LadillAppUrl.php new file mode 100644 index 0000000..c894f57 --- /dev/null +++ b/app/Support/LadillAppUrl.php @@ -0,0 +1,15 @@ + $title, + ]; + } +} diff --git a/app/Support/OrganizationBranding.php b/app/Support/OrganizationBranding.php new file mode 100644 index 0000000..126614f --- /dev/null +++ b/app/Support/OrganizationBranding.php @@ -0,0 +1,50 @@ +logo_path && Storage::disk('public')->exists($organization->logo_path)) { + $version = $organization->updated_at?->getTimestamp() ?? time(); + + return Storage::disk('public')->url($organization->logo_path).'?v='.$version; + } + + $path = public_path(self::DEFAULT_LOGO); + + return asset(self::DEFAULT_LOGO).'?v='.(@filemtime($path) ?: '1'); + } + + public static function logoAlt(Organization $organization): string + { + return $organization->logo_path ? $organization->name : 'Ladill Care'; + } + + public static function hasCustomLogo(Organization $organization): bool + { + return $organization->logo_path !== null + && Storage::disk('public')->exists($organization->logo_path); + } + + public static function storeLogo(Organization $organization, UploadedFile $file): string + { + self::deleteStoredLogo($organization); + + return $file->store('care/organizations/'.$organization->id, 'public'); + } + + public static function deleteStoredLogo(Organization $organization): void + { + if ($organization->logo_path) { + Storage::disk('public')->delete($organization->logo_path); + } + } +} diff --git a/app/Support/UserProfileMenu.php b/app/Support/UserProfileMenu.php new file mode 100644 index 0000000..9461caf --- /dev/null +++ b/app/Support/UserProfileMenu.php @@ -0,0 +1,163 @@ +> + */ + public static function items(?Authenticatable $user = null): array + { + $user ??= auth()->user(); + + if (! $user) { + return []; + } + + $items = []; + + foreach ([ + ['label' => 'Home', 'path' => '', 'host' => 'home'], + ['label' => 'Profile', 'path' => 'profile'], + ['label' => 'Account Settings', 'path' => 'account-settings'], + ['label' => 'Dashboard', 'path' => 'dashboard'], + ['label' => 'Billing', 'path' => 'billing'], + ] as $link) { + $href = self::platformUrl($link['host'] ?? 'account', $link['path']); + + if (self::isCurrentMenuLink($link, $href)) { + continue; + } + + $items[] = [ + 'type' => 'link', + 'label' => $link['label'], + 'href' => $href, + ]; + } + + if (Route::has((string) config('billing.wallet_balance_route', 'wallet.balance'))) { + $items[] = ['type' => 'wallet']; + } + + if (self::userIsAdmin($user)) { + $adminHref = self::platformUrl('account', 'admin'); + + if (! self::isCurrentMenuLink(['path' => 'admin', 'host' => 'account'], $adminHref)) { + $items[] = [ + 'type' => 'link', + 'label' => 'Admin', + 'href' => $adminHref, + ]; + } + } + + if (Route::has('logout')) { + $items[] = [ + 'type' => 'logout', + 'label' => 'Logout', + 'action' => route('logout'), + ]; + } + + return $items; + } + + private static function platformUrl(string $host, string $path = ''): string + { + if ($host === 'home') { + if (function_exists('ladill_home_url')) { + return ladill_home_url($path); + } + + $domain = config('app.home_domain'); + if (! $domain) { + $platform = (string) config('app.platform_domain', parse_url((string) config('app.url', ''), PHP_URL_HOST) ?: ''); + $domain = $platform !== '' ? 'home.'.$platform : (string) config('app.account_domain'); + } + + return self::absoluteUrl((string) $domain, $path); + } + + if (function_exists('ladill_account_url')) { + return ladill_account_url($path); + } + + return self::absoluteUrl((string) config('app.account_domain'), $path); + } + + /** + * Hide a menu link when the signed-in user is already on that destination. + * + * @param array{label?: string, path?: string, host?: string} $link + */ + private static function isCurrentMenuLink(array $link, string $href): bool + { + if (app()->runningInConsole() && ! app()->runningUnitTests()) { + return false; + } + + $request = request(); + if (! $request) { + return false; + } + + $linkHost = strtolower((string) parse_url($href, PHP_URL_HOST)); + $currentHost = strtolower($request->getHost()); + + if ($linkHost === '' || $linkHost !== $currentHost) { + return false; + } + + $currentPath = trim($request->getPathInfo(), '/'); + $targetPath = trim((string) parse_url($href, PHP_URL_PATH), '/'); + + if (($link['host'] ?? 'account') === 'home') { + return $currentPath === ''; + } + + if (($link['path'] ?? '') === 'dashboard') { + return in_array($currentPath, ['dashboard', 'account'], true) + || ($targetPath !== '' && self::pathMatchesSection($currentPath, $targetPath)); + } + + return self::pathMatchesSection($currentPath, $targetPath); + } + + private static function pathMatchesSection(string $currentPath, string $targetPath): bool + { + if ($targetPath === '') { + return $currentPath === ''; + } + + return $currentPath === $targetPath + || str_starts_with($currentPath, $targetPath.'/'); + } + + private static function absoluteUrl(string $domain, string $path = ''): string + { + $base = 'https://'.trim($domain, '/'); + + if ($path === '') { + return $base; + } + + return $base.'/'.ltrim($path, '/'); + } + + private static function userIsAdmin(Authenticatable $user): bool + { + if (method_exists($user, 'isAdmin')) { + return $user->isAdmin(); + } + + return (bool) ($user->is_admin ?? false); + } +} diff --git a/app/Support/helpers.php b/app/Support/helpers.php new file mode 100644 index 0000000..6ae16b2 --- /dev/null +++ b/app/Support/helpers.php @@ -0,0 +1,55 @@ +handleCommand(new ArgvInput); + +exit($status); diff --git a/bootstrap/app.php b/bootstrap/app.php new file mode 100644 index 0000000..cb75851 --- /dev/null +++ b/bootstrap/app.php @@ -0,0 +1,39 @@ +withRouting( + web: __DIR__.'/../routes/web.php', + api: __DIR__.'/../routes/api.php', + commands: __DIR__.'/../routes/console.php', + health: '/up', + then: function () { + \Illuminate\Support\Facades\Route::bind('investigation', function (string $value) { + return \App\Models\InvestigationRequest::where('uuid', $value)->firstOrFail(); + }); + }, + ) + ->withMiddleware(function (Middleware $middleware): void { + $middleware->redirectGuestsTo(fn (Request $request) => route('sso.connect', [ + 'redirect' => $request->fullUrl(), + ])); + $middleware->web(append: [ + SetActingAccount::class, + ]); + $middleware->alias([ + 'auth.service' => AuthenticateService::class, + 'platform.session' => EnsurePlatformSession::class, + 'care.setup' => \App\Http\Middleware\EnsureOrganizationSetup::class, + 'care.ability' => \App\Http\Middleware\EnsureCareAbility::class, + ]); + }) + ->withExceptions(function (Exceptions $exceptions): void { + // + })->create(); diff --git a/bootstrap/cache/.gitignore b/bootstrap/cache/.gitignore new file mode 100644 index 0000000..d6b7ef3 --- /dev/null +++ b/bootstrap/cache/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/bootstrap/providers.php b/bootstrap/providers.php new file mode 100644 index 0000000..fc94ae6 --- /dev/null +++ b/bootstrap/providers.php @@ -0,0 +1,7 @@ +=5.0.0" + }, + "require-dev": { + "doctrine/dbal": "^4.0.0", + "nesbot/carbon": "^2.71.0 || ^3.0.0", + "phpunit/phpunit": "^10.3" + }, + "type": "library", + "autoload": { + "psr-4": { + "Carbon\\Doctrine\\": "src/Carbon/Doctrine/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "KyleKatarn", + "email": "kylekatarnls@gmail.com" + } + ], + "description": "Types to use Carbon in Doctrine", + "keywords": [ + "carbon", + "date", + "datetime", + "doctrine", + "time" + ], + "support": { + "issues": "https://github.com/CarbonPHP/carbon-doctrine-types/issues", + "source": "https://github.com/CarbonPHP/carbon-doctrine-types/tree/3.2.0" + }, + "funding": [ + { + "url": "https://github.com/kylekatarnls", + "type": "github" + }, + { + "url": "https://opencollective.com/Carbon", + "type": "open_collective" + }, + { + "url": "https://tidelift.com/funding/github/packagist/nesbot/carbon", + "type": "tidelift" + } + ], + "time": "2024-02-09T16:56:22+00:00" + }, + { + "name": "chillerlan/php-qrcode", + "version": "5.0.5", + "source": { + "type": "git", + "url": "https://github.com/chillerlan/php-qrcode.git", + "reference": "7b66282572fc14075c0507d74d9837dab25b38d6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/chillerlan/php-qrcode/zipball/7b66282572fc14075c0507d74d9837dab25b38d6", + "reference": "7b66282572fc14075c0507d74d9837dab25b38d6", + "shasum": "" + }, + "require": { + "chillerlan/php-settings-container": "^2.1.6 || ^3.2.1", + "ext-mbstring": "*", + "php": "^7.4 || ^8.0" + }, + "require-dev": { + "chillerlan/php-authenticator": "^4.3.1 || ^5.2.1", + "ext-fileinfo": "*", + "phan/phan": "^5.5.2", + "phpcompatibility/php-compatibility": "10.x-dev", + "phpmd/phpmd": "^2.15", + "phpunit/phpunit": "^9.6", + "setasign/fpdf": "^1.8.2", + "slevomat/coding-standard": "^8.23.0", + "squizlabs/php_codesniffer": "^4.0.0" + }, + "suggest": { + "chillerlan/php-authenticator": "Yet another Google authenticator! Also creates URIs for mobile apps.", + "setasign/fpdf": "Required to use the QR FPDF output.", + "simple-icons/simple-icons": "SVG icons that you can use to embed as logos in the QR Code" + }, + "type": "library", + "autoload": { + "psr-4": { + "chillerlan\\QRCode\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT", + "Apache-2.0" + ], + "authors": [ + { + "name": "Kazuhiko Arase", + "homepage": "https://github.com/kazuhikoarase/qrcode-generator" + }, + { + "name": "ZXing Authors", + "homepage": "https://github.com/zxing/zxing" + }, + { + "name": "Ashot Khanamiryan", + "homepage": "https://github.com/khanamiryan/php-qrcode-detector-decoder" + }, + { + "name": "Smiley", + "email": "smiley@chillerlan.net", + "homepage": "https://github.com/codemasher" + }, + { + "name": "Contributors", + "homepage": "https://github.com/chillerlan/php-qrcode/graphs/contributors" + } + ], + "description": "A QR Code generator and reader with a user-friendly API. PHP 7.4+", + "homepage": "https://github.com/chillerlan/php-qrcode", + "keywords": [ + "phpqrcode", + "qr", + "qr code", + "qr-reader", + "qrcode", + "qrcode-generator", + "qrcode-reader" + ], + "support": { + "docs": "https://php-qrcode.readthedocs.io", + "issues": "https://github.com/chillerlan/php-qrcode/issues", + "source": "https://github.com/chillerlan/php-qrcode" + }, + "funding": [ + { + "url": "https://ko-fi.com/codemasher", + "type": "Ko-Fi" + } + ], + "time": "2025-11-23T23:51:44+00:00" + }, + { + "name": "chillerlan/php-settings-container", + "version": "3.3.0", + "source": { + "type": "git", + "url": "https://github.com/chillerlan/php-settings-container.git", + "reference": "a0a487cbf5344f721eb504bf0f59bada40c381b7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/chillerlan/php-settings-container/zipball/a0a487cbf5344f721eb504bf0f59bada40c381b7", + "reference": "a0a487cbf5344f721eb504bf0f59bada40c381b7", + "shasum": "" + }, + "require": { + "ext-json": "*", + "php": "^8.1" + }, + "require-dev": { + "phan/phan": "^5.5.2", + "phpmd/phpmd": "^2.15", + "phpstan/phpstan": "^2.1.31", + "phpstan/phpstan-deprecation-rules": "^2.0.3", + "phpunit/phpunit": "^10.5", + "slevomat/coding-standard": "^8.22", + "squizlabs/php_codesniffer": "^4.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "chillerlan\\Settings\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Smiley", + "email": "smiley@chillerlan.net", + "homepage": "https://github.com/codemasher" + } + ], + "description": "A container class for immutable settings objects. Not a DI container.", + "homepage": "https://github.com/chillerlan/php-settings-container", + "keywords": [ + "Settings", + "configuration", + "container", + "helper", + "property hook" + ], + "support": { + "issues": "https://github.com/chillerlan/php-settings-container/issues", + "source": "https://github.com/chillerlan/php-settings-container" + }, + "funding": [ + { + "url": "https://www.paypal.com/donate?hosted_button_id=WLYUNAT9ZTJZ4", + "type": "custom" + }, + { + "url": "https://ko-fi.com/codemasher", + "type": "ko_fi" + } + ], + "time": "2026-03-20T21:10:52+00:00" + }, + { + "name": "dflydev/dot-access-data", + "version": "v3.0.3", + "source": { + "type": "git", + "url": "https://github.com/dflydev/dflydev-dot-access-data.git", + "reference": "a23a2bf4f31d3518f3ecb38660c95715dfead60f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/dflydev/dflydev-dot-access-data/zipball/a23a2bf4f31d3518f3ecb38660c95715dfead60f", + "reference": "a23a2bf4f31d3518f3ecb38660c95715dfead60f", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^0.12.42", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.3", + "scrutinizer/ocular": "1.6.0", + "squizlabs/php_codesniffer": "^3.5", + "vimeo/psalm": "^4.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Dflydev\\DotAccessData\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Dragonfly Development Inc.", + "email": "info@dflydev.com", + "homepage": "http://dflydev.com" + }, + { + "name": "Beau Simensen", + "email": "beau@dflydev.com", + "homepage": "http://beausimensen.com" + }, + { + "name": "Carlos Frutos", + "email": "carlos@kiwing.it", + "homepage": "https://github.com/cfrutos" + }, + { + "name": "Colin O'Dell", + "email": "colinodell@gmail.com", + "homepage": "https://www.colinodell.com" + } + ], + "description": "Given a deep data structure, access data by dot notation.", + "homepage": "https://github.com/dflydev/dflydev-dot-access-data", + "keywords": [ + "access", + "data", + "dot", + "notation" + ], + "support": { + "issues": "https://github.com/dflydev/dflydev-dot-access-data/issues", + "source": "https://github.com/dflydev/dflydev-dot-access-data/tree/v3.0.3" + }, + "time": "2024-07-08T12:26:09+00:00" + }, + { + "name": "doctrine/inflector", + "version": "2.1.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/inflector.git", + "reference": "6d6c96277ea252fc1304627204c3d5e6e15faa3b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/inflector/zipball/6d6c96277ea252fc1304627204c3d5e6e15faa3b", + "reference": "6d6c96277ea252fc1304627204c3d5e6e15faa3b", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "require-dev": { + "doctrine/coding-standard": "^12.0 || ^13.0", + "phpstan/phpstan": "^1.12 || ^2.0", + "phpstan/phpstan-phpunit": "^1.4 || ^2.0", + "phpstan/phpstan-strict-rules": "^1.6 || ^2.0", + "phpunit/phpunit": "^8.5 || ^12.2" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Inflector\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "PHP Doctrine Inflector is a small library that can perform string manipulations with regard to upper/lowercase and singular/plural forms of words.", + "homepage": "https://www.doctrine-project.org/projects/inflector.html", + "keywords": [ + "inflection", + "inflector", + "lowercase", + "manipulation", + "php", + "plural", + "singular", + "strings", + "uppercase", + "words" + ], + "support": { + "issues": "https://github.com/doctrine/inflector/issues", + "source": "https://github.com/doctrine/inflector/tree/2.1.0" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finflector", + "type": "tidelift" + } + ], + "time": "2025-08-10T19:31:58+00:00" + }, + { + "name": "doctrine/lexer", + "version": "3.0.1", + "source": { + "type": "git", + "url": "https://github.com/doctrine/lexer.git", + "reference": "31ad66abc0fc9e1a1f2d9bc6a42668d2fbbcd6dd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/lexer/zipball/31ad66abc0fc9e1a1f2d9bc6a42668d2fbbcd6dd", + "reference": "31ad66abc0fc9e1a1f2d9bc6a42668d2fbbcd6dd", + "shasum": "" + }, + "require": { + "php": "^8.1" + }, + "require-dev": { + "doctrine/coding-standard": "^12", + "phpstan/phpstan": "^1.10", + "phpunit/phpunit": "^10.5", + "psalm/plugin-phpunit": "^0.18.3", + "vimeo/psalm": "^5.21" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Common\\Lexer\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.", + "homepage": "https://www.doctrine-project.org/projects/lexer.html", + "keywords": [ + "annotations", + "docblock", + "lexer", + "parser", + "php" + ], + "support": { + "issues": "https://github.com/doctrine/lexer/issues", + "source": "https://github.com/doctrine/lexer/tree/3.0.1" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Flexer", + "type": "tidelift" + } + ], + "time": "2024-02-05T11:56:58+00:00" + }, + { + "name": "dragonmantank/cron-expression", + "version": "v3.6.0", + "source": { + "type": "git", + "url": "https://github.com/dragonmantank/cron-expression.git", + "reference": "d61a8a9604ec1f8c3d150d09db6ce98b32675013" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/dragonmantank/cron-expression/zipball/d61a8a9604ec1f8c3d150d09db6ce98b32675013", + "reference": "d61a8a9604ec1f8c3d150d09db6ce98b32675013", + "shasum": "" + }, + "require": { + "php": "^8.2|^8.3|^8.4|^8.5" + }, + "replace": { + "mtdowling/cron-expression": "^1.0" + }, + "require-dev": { + "phpstan/extension-installer": "^1.4.3", + "phpstan/phpstan": "^1.12.32|^2.1.31", + "phpunit/phpunit": "^8.5.48|^9.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Cron\\": "src/Cron/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Chris Tankersley", + "email": "chris@ctankersley.com", + "homepage": "https://github.com/dragonmantank" + } + ], + "description": "CRON for PHP: Calculate the next or previous run date and determine if a CRON expression is due", + "keywords": [ + "cron", + "schedule" + ], + "support": { + "issues": "https://github.com/dragonmantank/cron-expression/issues", + "source": "https://github.com/dragonmantank/cron-expression/tree/v3.6.0" + }, + "funding": [ + { + "url": "https://github.com/dragonmantank", + "type": "github" + } + ], + "time": "2025-10-31T18:51:33+00:00" + }, + { + "name": "egulias/email-validator", + "version": "4.0.4", + "source": { + "type": "git", + "url": "https://github.com/egulias/EmailValidator.git", + "reference": "d42c8731f0624ad6bdc8d3e5e9a4524f68801cfa" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/egulias/EmailValidator/zipball/d42c8731f0624ad6bdc8d3e5e9a4524f68801cfa", + "reference": "d42c8731f0624ad6bdc8d3e5e9a4524f68801cfa", + "shasum": "" + }, + "require": { + "doctrine/lexer": "^2.0 || ^3.0", + "php": ">=8.1", + "symfony/polyfill-intl-idn": "^1.26" + }, + "require-dev": { + "phpunit/phpunit": "^10.2", + "vimeo/psalm": "^5.12" + }, + "suggest": { + "ext-intl": "PHP Internationalization Libraries are required to use the SpoofChecking validation" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Egulias\\EmailValidator\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Eduardo Gulias Davis" + } + ], + "description": "A library for validating emails against several RFCs", + "homepage": "https://github.com/egulias/EmailValidator", + "keywords": [ + "email", + "emailvalidation", + "emailvalidator", + "validation", + "validator" + ], + "support": { + "issues": "https://github.com/egulias/EmailValidator/issues", + "source": "https://github.com/egulias/EmailValidator/tree/4.0.4" + }, + "funding": [ + { + "url": "https://github.com/egulias", + "type": "github" + } + ], + "time": "2025-03-06T22:45:56+00:00" + }, + { + "name": "fruitcake/php-cors", + "version": "v1.4.0", + "source": { + "type": "git", + "url": "https://github.com/fruitcake/php-cors.git", + "reference": "38aaa6c3fd4c157ffe2a4d10aa8b9b16ba8de379" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/fruitcake/php-cors/zipball/38aaa6c3fd4c157ffe2a4d10aa8b9b16ba8de379", + "reference": "38aaa6c3fd4c157ffe2a4d10aa8b9b16ba8de379", + "shasum": "" + }, + "require": { + "php": "^8.1", + "symfony/http-foundation": "^5.4|^6.4|^7.3|^8" + }, + "require-dev": { + "phpstan/phpstan": "^2", + "phpunit/phpunit": "^9", + "squizlabs/php_codesniffer": "^4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3-dev" + } + }, + "autoload": { + "psr-4": { + "Fruitcake\\Cors\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fruitcake", + "homepage": "https://fruitcake.nl" + }, + { + "name": "Barryvdh", + "email": "barryvdh@gmail.com" + } + ], + "description": "Cross-origin resource sharing library for the Symfony HttpFoundation", + "homepage": "https://github.com/fruitcake/php-cors", + "keywords": [ + "cors", + "laravel", + "symfony" + ], + "support": { + "issues": "https://github.com/fruitcake/php-cors/issues", + "source": "https://github.com/fruitcake/php-cors/tree/v1.4.0" + }, + "funding": [ + { + "url": "https://fruitcake.nl", + "type": "custom" + }, + { + "url": "https://github.com/barryvdh", + "type": "github" + } + ], + "time": "2025-12-03T09:33:47+00:00" + }, + { + "name": "graham-campbell/result-type", + "version": "v1.1.4", + "source": { + "type": "git", + "url": "https://github.com/GrahamCampbell/Result-Type.git", + "reference": "e01f4a821471308ba86aa202fed6698b6b695e3b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/GrahamCampbell/Result-Type/zipball/e01f4a821471308ba86aa202fed6698b6b695e3b", + "reference": "e01f4a821471308ba86aa202fed6698b6b695e3b", + "shasum": "" + }, + "require": { + "php": "^7.2.5 || ^8.0", + "phpoption/phpoption": "^1.9.5" + }, + "require-dev": { + "phpunit/phpunit": "^8.5.41 || ^9.6.22 || ^10.5.45 || ^11.5.7" + }, + "type": "library", + "autoload": { + "psr-4": { + "GrahamCampbell\\ResultType\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + } + ], + "description": "An Implementation Of The Result Type", + "keywords": [ + "Graham Campbell", + "GrahamCampbell", + "Result Type", + "Result-Type", + "result" + ], + "support": { + "issues": "https://github.com/GrahamCampbell/Result-Type/issues", + "source": "https://github.com/GrahamCampbell/Result-Type/tree/v1.1.4" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/graham-campbell/result-type", + "type": "tidelift" + } + ], + "time": "2025-12-27T19:43:20+00:00" + }, + { + "name": "guzzlehttp/guzzle", + "version": "7.11.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/guzzle.git", + "reference": "c987f8ce84b8434fa430795eca0f3430663da72b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/c987f8ce84b8434fa430795eca0f3430663da72b", + "reference": "c987f8ce84b8434fa430795eca0f3430663da72b", + "shasum": "" + }, + "require": { + "ext-json": "*", + "guzzlehttp/promises": "^2.5", + "guzzlehttp/psr7": "^2.11", + "php": "^7.2.5 || ^8.0", + "psr/http-client": "^1.0", + "symfony/deprecation-contracts": "^2.5 || ^3.0", + "symfony/polyfill-php80": "^1.24" + }, + "provide": { + "psr/http-client-implementation": "1.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.2", + "ext-curl": "*", + "guzzle/client-integration-tests": "3.0.2", + "guzzlehttp/test-server": "^0.4", + "php-http/message-factory": "^1.1", + "phpunit/phpunit": "^8.5.52 || ^9.6.34", + "psr/log": "^1.1 || ^2.0 || ^3.0" + }, + "suggest": { + "ext-curl": "Required for CURL handler support", + "ext-intl": "Required for Internationalized Domain Name (IDN) support", + "psr/log": "Required for using the Log middleware" + }, + "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + } + }, + "autoload": { + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "GuzzleHttp\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Jeremy Lindblom", + "email": "jeremeamia@gmail.com", + "homepage": "https://github.com/jeremeamia" + }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + } + ], + "description": "Guzzle is a PHP HTTP client library", + "keywords": [ + "client", + "curl", + "framework", + "http", + "http client", + "psr-18", + "psr-7", + "rest", + "web service" + ], + "support": { + "issues": "https://github.com/guzzle/guzzle/issues", + "source": "https://github.com/guzzle/guzzle/tree/7.11.0" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/guzzle", + "type": "tidelift" + } + ], + "time": "2026-06-02T12:40:51+00:00" + }, + { + "name": "guzzlehttp/promises", + "version": "2.5.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/promises.git", + "reference": "4360e982f87f5f258bf872d094647791db2f4c8e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/promises/zipball/4360e982f87f5f258bf872d094647791db2f4c8e", + "reference": "4360e982f87f5f258bf872d094647791db2f4c8e", + "shasum": "" + }, + "require": { + "php": "^7.2.5 || ^8.0", + "symfony/deprecation-contracts": "^2.5 || ^3.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.2", + "phpunit/phpunit": "^8.5.52 || ^9.6.34" + }, + "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Promise\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + } + ], + "description": "Guzzle promises library", + "keywords": [ + "promise" + ], + "support": { + "issues": "https://github.com/guzzle/promises/issues", + "source": "https://github.com/guzzle/promises/tree/2.5.0" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/promises", + "type": "tidelift" + } + ], + "time": "2026-06-02T12:23:43+00:00" + }, + { + "name": "guzzlehttp/psr7", + "version": "2.11.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/psr7.git", + "reference": "bbb5e61349fa5cb822b3e87842b951088b76b81f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/bbb5e61349fa5cb822b3e87842b951088b76b81f", + "reference": "bbb5e61349fa5cb822b3e87842b951088b76b81f", + "shasum": "" + }, + "require": { + "php": "^7.2.5 || ^8.0", + "psr/http-factory": "^1.0", + "psr/http-message": "^1.1 || ^2.0", + "ralouphie/getallheaders": "^3.0", + "symfony/deprecation-contracts": "^2.5 || ^3.0", + "symfony/polyfill-php80": "^1.24" + }, + "provide": { + "psr/http-factory-implementation": "1.0", + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.2", + "http-interop/http-factory-tests": "1.1.0", + "jshttp/mime-db": "1.54.0.1", + "phpunit/phpunit": "^8.5.52 || ^9.6.34" + }, + "suggest": { + "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" + }, + "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Psr7\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://sagikazarmark.hu" + } + ], + "description": "PSR-7 message implementation that also provides common utility methods", + "keywords": [ + "http", + "message", + "psr-7", + "request", + "response", + "stream", + "uri", + "url" + ], + "support": { + "issues": "https://github.com/guzzle/psr7/issues", + "source": "https://github.com/guzzle/psr7/tree/2.11.0" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/psr7", + "type": "tidelift" + } + ], + "time": "2026-06-02T12:30:48+00:00" + }, + { + "name": "guzzlehttp/uri-template", + "version": "v1.0.6", + "source": { + "type": "git", + "url": "https://github.com/guzzle/uri-template.git", + "reference": "eef7f87bab6f204eba3c39224d8075c70c637946" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/uri-template/zipball/eef7f87bab6f204eba3c39224d8075c70c637946", + "reference": "eef7f87bab6f204eba3c39224d8075c70c637946", + "shasum": "" + }, + "require": { + "php": "^7.2.5 || ^8.0", + "symfony/polyfill-php80": "^1.24" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.2", + "phpunit/phpunit": "^8.5.52 || ^9.6.34", + "uri-template/tests": "1.0.0" + }, + "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\UriTemplate\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + } + ], + "description": "A polyfill class for uri_template of PHP", + "keywords": [ + "guzzlehttp", + "uri-template" + ], + "support": { + "issues": "https://github.com/guzzle/uri-template/issues", + "source": "https://github.com/guzzle/uri-template/tree/v1.0.6" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/uri-template", + "type": "tidelift" + } + ], + "time": "2026-05-23T22:00:21+00:00" + }, + { + "name": "laravel/framework", + "version": "v12.61.1", + "source": { + "type": "git", + "url": "https://github.com/laravel/framework.git", + "reference": "e8472ca9774452fe50841d9bdced060679f4d58d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laravel/framework/zipball/e8472ca9774452fe50841d9bdced060679f4d58d", + "reference": "e8472ca9774452fe50841d9bdced060679f4d58d", + "shasum": "" + }, + "require": { + "brick/math": "^0.11|^0.12|^0.13|^0.14", + "composer-runtime-api": "^2.2", + "doctrine/inflector": "^2.0.5", + "dragonmantank/cron-expression": "^3.4", + "egulias/email-validator": "^3.2.1|^4.0", + "ext-ctype": "*", + "ext-filter": "*", + "ext-hash": "*", + "ext-mbstring": "*", + "ext-openssl": "*", + "ext-session": "*", + "ext-tokenizer": "*", + "fruitcake/php-cors": "^1.3", + "guzzlehttp/guzzle": "^7.8.2", + "guzzlehttp/uri-template": "^1.0", + "laravel/prompts": "^0.3.0", + "laravel/serializable-closure": "^1.3|^2.0", + "league/commonmark": "^2.8.1", + "league/flysystem": "^3.25.1", + "league/flysystem-local": "^3.25.1", + "league/uri": "^7.5.1", + "monolog/monolog": "^3.0", + "nesbot/carbon": "^3.8.4", + "nunomaduro/termwind": "^2.0", + "php": "^8.2", + "psr/container": "^1.1.1|^2.0.1", + "psr/log": "^1.0|^2.0|^3.0", + "psr/simple-cache": "^1.0|^2.0|^3.0", + "ramsey/uuid": "^4.7", + "symfony/console": "^7.2.0", + "symfony/error-handler": "^7.2.0", + "symfony/finder": "^7.2.0", + "symfony/http-foundation": "^7.2.0", + "symfony/http-kernel": "^7.2.0", + "symfony/mailer": "^7.2.0", + "symfony/mime": "^7.2.0", + "symfony/polyfill-php83": "^1.33", + "symfony/polyfill-php84": "^1.34", + "symfony/polyfill-php85": "^1.34", + "symfony/process": "^7.2.0", + "symfony/routing": "^7.2.0", + "symfony/uid": "^7.2.0", + "symfony/var-dumper": "^7.2.0", + "tijsverkoyen/css-to-inline-styles": "^2.2.5", + "vlucas/phpdotenv": "^5.6.1", + "voku/portable-ascii": "^2.0.2" + }, + "conflict": { + "tightenco/collect": "<5.5.33" + }, + "provide": { + "psr/container-implementation": "1.1|2.0", + "psr/log-implementation": "1.0|2.0|3.0", + "psr/simple-cache-implementation": "1.0|2.0|3.0" + }, + "replace": { + "illuminate/auth": "self.version", + "illuminate/broadcasting": "self.version", + "illuminate/bus": "self.version", + "illuminate/cache": "self.version", + "illuminate/collections": "self.version", + "illuminate/concurrency": "self.version", + "illuminate/conditionable": "self.version", + "illuminate/config": "self.version", + "illuminate/console": "self.version", + "illuminate/container": "self.version", + "illuminate/contracts": "self.version", + "illuminate/cookie": "self.version", + "illuminate/database": "self.version", + "illuminate/encryption": "self.version", + "illuminate/events": "self.version", + "illuminate/filesystem": "self.version", + "illuminate/hashing": "self.version", + "illuminate/http": "self.version", + "illuminate/json-schema": "self.version", + "illuminate/log": "self.version", + "illuminate/macroable": "self.version", + "illuminate/mail": "self.version", + "illuminate/notifications": "self.version", + "illuminate/pagination": "self.version", + "illuminate/pipeline": "self.version", + "illuminate/process": "self.version", + "illuminate/queue": "self.version", + "illuminate/redis": "self.version", + "illuminate/reflection": "self.version", + "illuminate/routing": "self.version", + "illuminate/session": "self.version", + "illuminate/support": "self.version", + "illuminate/testing": "self.version", + "illuminate/translation": "self.version", + "illuminate/validation": "self.version", + "illuminate/view": "self.version", + "spatie/once": "*" + }, + "require-dev": { + "ably/ably-php": "^1.0", + "aws/aws-sdk-php": "^3.322.9", + "ext-gmp": "*", + "fakerphp/faker": "^1.24", + "guzzlehttp/promises": "^2.0.3", + "guzzlehttp/psr7": "^2.4", + "laravel/pint": "^1.18", + "league/flysystem-aws-s3-v3": "^3.25.1", + "league/flysystem-ftp": "^3.25.1", + "league/flysystem-path-prefixing": "^3.25.1", + "league/flysystem-read-only": "^3.25.1", + "league/flysystem-sftp-v3": "^3.25.1", + "mockery/mockery": "^1.6.10", + "opis/json-schema": "^2.4.1", + "orchestra/testbench-core": "^10.9.0", + "pda/pheanstalk": "^5.0.6|^7.0.0", + "php-http/discovery": "^1.15", + "phpstan/phpstan": "^2.1.41", + "phpunit/phpunit": "^10.5.35|^11.5.3|^12.0.1", + "predis/predis": "^2.3|^3.0", + "resend/resend-php": "^0.10.0|^1.0", + "symfony/cache": "^7.2.0", + "symfony/http-client": "^7.2.0", + "symfony/psr-http-message-bridge": "^7.2.0", + "symfony/translation": "^7.2.0" + }, + "suggest": { + "ably/ably-php": "Required to use the Ably broadcast driver (^1.0).", + "aws/aws-sdk-php": "Required to use the SQS queue driver, DynamoDb failed job storage, and SES mail driver (^3.322.9).", + "brianium/paratest": "Required to run tests in parallel (^7.0|^8.0).", + "ext-apcu": "Required to use the APC cache driver.", + "ext-fileinfo": "Required to use the Filesystem class.", + "ext-ftp": "Required to use the Flysystem FTP driver.", + "ext-gd": "Required to use Illuminate\\Http\\Testing\\FileFactory::image().", + "ext-memcached": "Required to use the memcache cache driver.", + "ext-pcntl": "Required to use all features of the queue worker and console signal trapping.", + "ext-pdo": "Required to use all database features.", + "ext-posix": "Required to use all features of the queue worker.", + "ext-redis": "Required to use the Redis cache and queue drivers (^4.0|^5.0|^6.0).", + "fakerphp/faker": "Required to generate fake data using the fake() helper (^1.23).", + "filp/whoops": "Required for friendly error pages in development (^2.14.3).", + "laravel/tinker": "Required to use the tinker console command (^2.0).", + "league/flysystem-aws-s3-v3": "Required to use the Flysystem S3 driver (^3.25.1).", + "league/flysystem-ftp": "Required to use the Flysystem FTP driver (^3.25.1).", + "league/flysystem-path-prefixing": "Required to use the scoped driver (^3.25.1).", + "league/flysystem-read-only": "Required to use read-only disks (^3.25.1)", + "league/flysystem-sftp-v3": "Required to use the Flysystem SFTP driver (^3.25.1).", + "mockery/mockery": "Required to use mocking (^1.6).", + "pda/pheanstalk": "Required to use the beanstalk queue driver (^5.0).", + "php-http/discovery": "Required to use PSR-7 bridging features (^1.15).", + "phpunit/phpunit": "Required to use assertions and run tests (^10.5.35|^11.5.3|^12.0.1).", + "predis/predis": "Required to use the predis connector (^2.3|^3.0).", + "psr/http-message": "Required to allow Storage::put to accept a StreamInterface (^1.0).", + "pusher/pusher-php-server": "Required to use the Pusher broadcast driver (^6.0|^7.0).", + "resend/resend-php": "Required to enable support for the Resend mail transport (^0.10.0|^1.0).", + "symfony/cache": "Required to PSR-6 cache bridge (^7.2).", + "symfony/filesystem": "Required to enable support for relative symbolic links (^7.2).", + "symfony/http-client": "Required to enable support for the Symfony API mail transports (^7.2).", + "symfony/mailgun-mailer": "Required to enable support for the Mailgun mail transport (^7.2).", + "symfony/postmark-mailer": "Required to enable support for the Postmark mail transport (^7.2).", + "symfony/psr-http-message-bridge": "Required to use PSR-7 bridging features (^7.2)." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "12.x-dev" + } + }, + "autoload": { + "files": [ + "src/Illuminate/Collections/functions.php", + "src/Illuminate/Collections/helpers.php", + "src/Illuminate/Events/functions.php", + "src/Illuminate/Filesystem/functions.php", + "src/Illuminate/Foundation/helpers.php", + "src/Illuminate/Log/functions.php", + "src/Illuminate/Reflection/helpers.php", + "src/Illuminate/Support/functions.php", + "src/Illuminate/Support/helpers.php" + ], + "psr-4": { + "Illuminate\\": "src/Illuminate/", + "Illuminate\\Support\\": [ + "src/Illuminate/Macroable/", + "src/Illuminate/Collections/", + "src/Illuminate/Conditionable/", + "src/Illuminate/Reflection/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "The Laravel Framework.", + "homepage": "https://laravel.com", + "keywords": [ + "framework", + "laravel" + ], + "support": { + "issues": "https://github.com/laravel/framework/issues", + "source": "https://github.com/laravel/framework" + }, + "time": "2026-06-04T14:22:52+00:00" + }, + { + "name": "laravel/prompts", + "version": "v0.3.18", + "source": { + "type": "git", + "url": "https://github.com/laravel/prompts.git", + "reference": "a19af51bb144bf87f08397921fa619f85c7d4e72" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laravel/prompts/zipball/a19af51bb144bf87f08397921fa619f85c7d4e72", + "reference": "a19af51bb144bf87f08397921fa619f85c7d4e72", + "shasum": "" + }, + "require": { + "composer-runtime-api": "^2.2", + "ext-mbstring": "*", + "php": "^8.1", + "symfony/console": "^6.2|^7.0|^8.0" + }, + "conflict": { + "illuminate/console": ">=10.17.0 <10.25.0", + "laravel/framework": ">=10.17.0 <10.25.0" + }, + "require-dev": { + "illuminate/collections": "^10.0|^11.0|^12.0|^13.0", + "mockery/mockery": "^1.5", + "pestphp/pest": "^2.3|^3.4|^4.0", + "phpstan/phpstan": "^1.12.28", + "phpstan/phpstan-mockery": "^1.1.3" + }, + "suggest": { + "ext-pcntl": "Required for the spinner to be animated." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "0.3.x-dev" + } + }, + "autoload": { + "files": [ + "src/helpers.php" + ], + "psr-4": { + "Laravel\\Prompts\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Add beautiful and user-friendly forms to your command-line applications.", + "support": { + "issues": "https://github.com/laravel/prompts/issues", + "source": "https://github.com/laravel/prompts/tree/v0.3.18" + }, + "time": "2026-05-19T00:47:18+00:00" + }, + { + "name": "laravel/sanctum", + "version": "v4.3.2", + "source": { + "type": "git", + "url": "https://github.com/laravel/sanctum.git", + "reference": "2a9bccc18e9907808e0018dd15fa643937886b1e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laravel/sanctum/zipball/2a9bccc18e9907808e0018dd15fa643937886b1e", + "reference": "2a9bccc18e9907808e0018dd15fa643937886b1e", + "shasum": "" + }, + "require": { + "ext-json": "*", + "illuminate/console": "^11.0|^12.0|^13.0", + "illuminate/contracts": "^11.0|^12.0|^13.0", + "illuminate/database": "^11.0|^12.0|^13.0", + "illuminate/support": "^11.0|^12.0|^13.0", + "php": "^8.2", + "symfony/console": "^7.0|^8.0" + }, + "require-dev": { + "mockery/mockery": "^1.6", + "orchestra/testbench": "^9.15|^10.8|^11.0", + "phpstan/phpstan": "^1.10" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Laravel\\Sanctum\\SanctumServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "Laravel\\Sanctum\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "Laravel Sanctum provides a featherweight authentication system for SPAs and simple APIs.", + "keywords": [ + "auth", + "laravel", + "sanctum" + ], + "support": { + "issues": "https://github.com/laravel/sanctum/issues", + "source": "https://github.com/laravel/sanctum" + }, + "time": "2026-04-30T11:46:25+00:00" + }, + { + "name": "laravel/serializable-closure", + "version": "v2.0.13", + "source": { + "type": "git", + "url": "https://github.com/laravel/serializable-closure.git", + "reference": "b566ee0dd251f3c4078bed003a7ce015f5ea6dce" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laravel/serializable-closure/zipball/b566ee0dd251f3c4078bed003a7ce015f5ea6dce", + "reference": "b566ee0dd251f3c4078bed003a7ce015f5ea6dce", + "shasum": "" + }, + "require": { + "php": "^8.1" + }, + "require-dev": { + "illuminate/support": "^10.0|^11.0|^12.0|^13.0", + "nesbot/carbon": "^2.67|^3.0", + "pestphp/pest": "^2.36|^3.0|^4.0", + "phpstan/phpstan": "^2.0", + "symfony/var-dumper": "^6.2.0|^7.0.0|^8.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "autoload": { + "psr-4": { + "Laravel\\SerializableClosure\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + }, + { + "name": "Nuno Maduro", + "email": "nuno@laravel.com" + } + ], + "description": "Laravel Serializable Closure provides an easy and secure way to serialize closures in PHP.", + "keywords": [ + "closure", + "laravel", + "serializable" + ], + "support": { + "issues": "https://github.com/laravel/serializable-closure/issues", + "source": "https://github.com/laravel/serializable-closure" + }, + "time": "2026-04-16T14:03:50+00:00" + }, + { + "name": "laravel/tinker", + "version": "v2.11.1", + "source": { + "type": "git", + "url": "https://github.com/laravel/tinker.git", + "reference": "c9f80cc835649b5c1842898fb043f8cc098dd741" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laravel/tinker/zipball/c9f80cc835649b5c1842898fb043f8cc098dd741", + "reference": "c9f80cc835649b5c1842898fb043f8cc098dd741", + "shasum": "" + }, + "require": { + "illuminate/console": "^6.0|^7.0|^8.0|^9.0|^10.0|^11.0|^12.0", + "illuminate/contracts": "^6.0|^7.0|^8.0|^9.0|^10.0|^11.0|^12.0", + "illuminate/support": "^6.0|^7.0|^8.0|^9.0|^10.0|^11.0|^12.0", + "php": "^7.2.5|^8.0", + "psy/psysh": "^0.11.1|^0.12.0", + "symfony/var-dumper": "^4.3.4|^5.0|^6.0|^7.0|^8.0" + }, + "require-dev": { + "mockery/mockery": "~1.3.3|^1.4.2", + "phpstan/phpstan": "^1.10", + "phpunit/phpunit": "^8.5.8|^9.3.3|^10.0" + }, + "suggest": { + "illuminate/database": "The Illuminate Database package (^6.0|^7.0|^8.0|^9.0|^10.0|^11.0|^12.0)." + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Laravel\\Tinker\\TinkerServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "Laravel\\Tinker\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "Powerful REPL for the Laravel framework.", + "keywords": [ + "REPL", + "Tinker", + "laravel", + "psysh" + ], + "support": { + "issues": "https://github.com/laravel/tinker/issues", + "source": "https://github.com/laravel/tinker/tree/v2.11.1" + }, + "time": "2026-02-06T14:12:35+00:00" + }, + { + "name": "league/commonmark", + "version": "2.8.2", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/commonmark.git", + "reference": "59fb075d2101740c337c7216e3f32b36c204218b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/commonmark/zipball/59fb075d2101740c337c7216e3f32b36c204218b", + "reference": "59fb075d2101740c337c7216e3f32b36c204218b", + "shasum": "" + }, + "require": { + "ext-mbstring": "*", + "league/config": "^1.1.1", + "php": "^7.4 || ^8.0", + "psr/event-dispatcher": "^1.0", + "symfony/deprecation-contracts": "^2.1 || ^3.0", + "symfony/polyfill-php80": "^1.16" + }, + "require-dev": { + "cebe/markdown": "^1.0", + "commonmark/cmark": "0.31.1", + "commonmark/commonmark.js": "0.31.1", + "composer/package-versions-deprecated": "^1.8", + "embed/embed": "^4.4", + "erusev/parsedown": "^1.0", + "ext-json": "*", + "github/gfm": "0.29.0", + "michelf/php-markdown": "^1.4 || ^2.0", + "nyholm/psr7": "^1.5", + "phpstan/phpstan": "^1.8.2", + "phpunit/phpunit": "^9.5.21 || ^10.5.9 || ^11.0.0", + "scrutinizer/ocular": "^1.8.1", + "symfony/finder": "^5.3 | ^6.0 | ^7.0 || ^8.0", + "symfony/process": "^5.4 | ^6.0 | ^7.0 || ^8.0", + "symfony/yaml": "^2.3 | ^3.0 | ^4.0 | ^5.0 | ^6.0 | ^7.0 || ^8.0", + "unleashedtech/php-coding-standard": "^3.1.1", + "vimeo/psalm": "^4.24.0 || ^5.0.0 || ^6.0.0" + }, + "suggest": { + "symfony/yaml": "v2.3+ required if using the Front Matter extension" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.9-dev" + } + }, + "autoload": { + "psr-4": { + "League\\CommonMark\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Colin O'Dell", + "email": "colinodell@gmail.com", + "homepage": "https://www.colinodell.com", + "role": "Lead Developer" + } + ], + "description": "Highly-extensible PHP Markdown parser which fully supports the CommonMark spec and GitHub-Flavored Markdown (GFM)", + "homepage": "https://commonmark.thephpleague.com", + "keywords": [ + "commonmark", + "flavored", + "gfm", + "github", + "github-flavored", + "markdown", + "md", + "parser" + ], + "support": { + "docs": "https://commonmark.thephpleague.com/", + "forum": "https://github.com/thephpleague/commonmark/discussions", + "issues": "https://github.com/thephpleague/commonmark/issues", + "rss": "https://github.com/thephpleague/commonmark/releases.atom", + "source": "https://github.com/thephpleague/commonmark" + }, + "funding": [ + { + "url": "https://www.colinodell.com/sponsor", + "type": "custom" + }, + { + "url": "https://www.paypal.me/colinpodell/10.00", + "type": "custom" + }, + { + "url": "https://github.com/colinodell", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/league/commonmark", + "type": "tidelift" + } + ], + "time": "2026-03-19T13:16:38+00:00" + }, + { + "name": "league/config", + "version": "v1.2.0", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/config.git", + "reference": "754b3604fb2984c71f4af4a9cbe7b57f346ec1f3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/config/zipball/754b3604fb2984c71f4af4a9cbe7b57f346ec1f3", + "reference": "754b3604fb2984c71f4af4a9cbe7b57f346ec1f3", + "shasum": "" + }, + "require": { + "dflydev/dot-access-data": "^3.0.1", + "nette/schema": "^1.2", + "php": "^7.4 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^1.8.2", + "phpunit/phpunit": "^9.5.5", + "scrutinizer/ocular": "^1.8.1", + "unleashedtech/php-coding-standard": "^3.1", + "vimeo/psalm": "^4.7.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.2-dev" + } + }, + "autoload": { + "psr-4": { + "League\\Config\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Colin O'Dell", + "email": "colinodell@gmail.com", + "homepage": "https://www.colinodell.com", + "role": "Lead Developer" + } + ], + "description": "Define configuration arrays with strict schemas and access values with dot notation", + "homepage": "https://config.thephpleague.com", + "keywords": [ + "array", + "config", + "configuration", + "dot", + "dot-access", + "nested", + "schema" + ], + "support": { + "docs": "https://config.thephpleague.com/", + "issues": "https://github.com/thephpleague/config/issues", + "rss": "https://github.com/thephpleague/config/releases.atom", + "source": "https://github.com/thephpleague/config" + }, + "funding": [ + { + "url": "https://www.colinodell.com/sponsor", + "type": "custom" + }, + { + "url": "https://www.paypal.me/colinpodell/10.00", + "type": "custom" + }, + { + "url": "https://github.com/colinodell", + "type": "github" + } + ], + "time": "2022-12-11T20:36:23+00:00" + }, + { + "name": "league/flysystem", + "version": "3.34.0", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/flysystem.git", + "reference": "2daaac3b0d4c83ea7ed5d8586e786f5d00f3540e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/2daaac3b0d4c83ea7ed5d8586e786f5d00f3540e", + "reference": "2daaac3b0d4c83ea7ed5d8586e786f5d00f3540e", + "shasum": "" + }, + "require": { + "league/flysystem-local": "^3.0.0", + "league/mime-type-detection": "^1.0.0", + "php": "^8.0.2" + }, + "conflict": { + "async-aws/core": "<1.19.0", + "async-aws/s3": "<1.14.0", + "aws/aws-sdk-php": "3.209.31 || 3.210.0", + "guzzlehttp/guzzle": "<7.0", + "guzzlehttp/ringphp": "<1.1.1", + "phpseclib/phpseclib": "3.0.15", + "symfony/http-client": "<5.2" + }, + "require-dev": { + "async-aws/s3": "^1.5 || ^2.0", + "async-aws/simple-s3": "^1.1 || ^2.0", + "aws/aws-sdk-php": "^3.295.10", + "composer/semver": "^3.0", + "ext-fileinfo": "*", + "ext-ftp": "*", + "ext-mongodb": "^1.3|^2", + "ext-zip": "*", + "friendsofphp/php-cs-fixer": "^3.5", + "google/cloud-storage": "^1.23", + "guzzlehttp/psr7": "^2.6", + "microsoft/azure-storage-blob": "^1.1", + "mongodb/mongodb": "^1.2|^2", + "phpseclib/phpseclib": "^3.0.36", + "phpstan/phpstan": "^1.10", + "phpunit/phpunit": "^9.5.11|^10.0", + "sabre/dav": "^4.6.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "League\\Flysystem\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Frank de Jonge", + "email": "info@frankdejonge.nl" + } + ], + "description": "File storage abstraction for PHP", + "keywords": [ + "WebDAV", + "aws", + "cloud", + "file", + "files", + "filesystem", + "filesystems", + "ftp", + "s3", + "sftp", + "storage" + ], + "support": { + "issues": "https://github.com/thephpleague/flysystem/issues", + "source": "https://github.com/thephpleague/flysystem/tree/3.34.0" + }, + "time": "2026-05-14T10:28:08+00:00" + }, + { + "name": "league/flysystem-local", + "version": "3.31.0", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/flysystem-local.git", + "reference": "2f669db18a4c20c755c2bb7d3a7b0b2340488079" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/flysystem-local/zipball/2f669db18a4c20c755c2bb7d3a7b0b2340488079", + "reference": "2f669db18a4c20c755c2bb7d3a7b0b2340488079", + "shasum": "" + }, + "require": { + "ext-fileinfo": "*", + "league/flysystem": "^3.0.0", + "league/mime-type-detection": "^1.0.0", + "php": "^8.0.2" + }, + "type": "library", + "autoload": { + "psr-4": { + "League\\Flysystem\\Local\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Frank de Jonge", + "email": "info@frankdejonge.nl" + } + ], + "description": "Local filesystem adapter for Flysystem.", + "keywords": [ + "Flysystem", + "file", + "files", + "filesystem", + "local" + ], + "support": { + "source": "https://github.com/thephpleague/flysystem-local/tree/3.31.0" + }, + "time": "2026-01-23T15:30:45+00:00" + }, + { + "name": "league/mime-type-detection", + "version": "1.16.0", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/mime-type-detection.git", + "reference": "2d6702ff215bf922936ccc1ad31007edc76451b9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/2d6702ff215bf922936ccc1ad31007edc76451b9", + "reference": "2d6702ff215bf922936ccc1ad31007edc76451b9", + "shasum": "" + }, + "require": { + "ext-fileinfo": "*", + "php": "^7.4 || ^8.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^3.2", + "phpstan/phpstan": "^0.12.68", + "phpunit/phpunit": "^8.5.8 || ^9.3 || ^10.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "League\\MimeTypeDetection\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Frank de Jonge", + "email": "info@frankdejonge.nl" + } + ], + "description": "Mime-type detection for Flysystem", + "support": { + "issues": "https://github.com/thephpleague/mime-type-detection/issues", + "source": "https://github.com/thephpleague/mime-type-detection/tree/1.16.0" + }, + "funding": [ + { + "url": "https://github.com/frankdejonge", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/league/flysystem", + "type": "tidelift" + } + ], + "time": "2024-09-21T08:32:55+00:00" + }, + { + "name": "league/uri", + "version": "7.8.1", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/uri.git", + "reference": "08cf38e3924d4f56238125547b5720496fac8fd4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/uri/zipball/08cf38e3924d4f56238125547b5720496fac8fd4", + "reference": "08cf38e3924d4f56238125547b5720496fac8fd4", + "shasum": "" + }, + "require": { + "league/uri-interfaces": "^7.8.1", + "php": "^8.1", + "psr/http-factory": "^1" + }, + "conflict": { + "league/uri-schemes": "^1.0" + }, + "suggest": { + "ext-bcmath": "to improve IPV4 host parsing", + "ext-dom": "to convert the URI into an HTML anchor tag", + "ext-fileinfo": "to create Data URI from file contennts", + "ext-gmp": "to improve IPV4 host parsing", + "ext-intl": "to handle IDN host with the best performance", + "ext-uri": "to use the PHP native URI class", + "jeremykendall/php-domain-parser": "to further parse the URI host and resolve its Public Suffix and Top Level Domain", + "league/uri-components": "to provide additional tools to manipulate URI objects components", + "league/uri-polyfill": "to backport the PHP URI extension for older versions of PHP", + "php-64bit": "to improve IPV4 host parsing", + "rowbot/url": "to handle URLs using the WHATWG URL Living Standard specification", + "symfony/polyfill-intl-idn": "to handle IDN host via the Symfony polyfill if ext-intl is not present" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "7.x-dev" + } + }, + "autoload": { + "psr-4": { + "League\\Uri\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ignace Nyamagana Butera", + "email": "nyamsprod@gmail.com", + "homepage": "https://nyamsprod.com" + } + ], + "description": "URI manipulation library", + "homepage": "https://uri.thephpleague.com", + "keywords": [ + "URN", + "data-uri", + "file-uri", + "ftp", + "hostname", + "http", + "https", + "middleware", + "parse_str", + "parse_url", + "psr-7", + "query-string", + "querystring", + "rfc2141", + "rfc3986", + "rfc3987", + "rfc6570", + "rfc8141", + "uri", + "uri-template", + "url", + "ws" + ], + "support": { + "docs": "https://uri.thephpleague.com", + "forum": "https://thephpleague.slack.com", + "issues": "https://github.com/thephpleague/uri-src/issues", + "source": "https://github.com/thephpleague/uri/tree/7.8.1" + }, + "funding": [ + { + "url": "https://github.com/sponsors/nyamsprod", + "type": "github" + } + ], + "time": "2026-03-15T20:22:25+00:00" + }, + { + "name": "league/uri-interfaces", + "version": "7.8.1", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/uri-interfaces.git", + "reference": "85d5c77c5d6d3af6c54db4a78246364908f3c928" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/uri-interfaces/zipball/85d5c77c5d6d3af6c54db4a78246364908f3c928", + "reference": "85d5c77c5d6d3af6c54db4a78246364908f3c928", + "shasum": "" + }, + "require": { + "ext-filter": "*", + "php": "^8.1", + "psr/http-message": "^1.1 || ^2.0" + }, + "suggest": { + "ext-bcmath": "to improve IPV4 host parsing", + "ext-gmp": "to improve IPV4 host parsing", + "ext-intl": "to handle IDN host with the best performance", + "php-64bit": "to improve IPV4 host parsing", + "rowbot/url": "to handle URLs using the WHATWG URL Living Standard specification", + "symfony/polyfill-intl-idn": "to handle IDN host via the Symfony polyfill if ext-intl is not present" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "7.x-dev" + } + }, + "autoload": { + "psr-4": { + "League\\Uri\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ignace Nyamagana Butera", + "email": "nyamsprod@gmail.com", + "homepage": "https://nyamsprod.com" + } + ], + "description": "Common tools for parsing and resolving RFC3987/RFC3986 URI", + "homepage": "https://uri.thephpleague.com", + "keywords": [ + "data-uri", + "file-uri", + "ftp", + "hostname", + "http", + "https", + "parse_str", + "parse_url", + "psr-7", + "query-string", + "querystring", + "rfc3986", + "rfc3987", + "rfc6570", + "uri", + "url", + "ws" + ], + "support": { + "docs": "https://uri.thephpleague.com", + "forum": "https://thephpleague.slack.com", + "issues": "https://github.com/thephpleague/uri-src/issues", + "source": "https://github.com/thephpleague/uri-interfaces/tree/7.8.1" + }, + "funding": [ + { + "url": "https://github.com/sponsors/nyamsprod", + "type": "github" + } + ], + "time": "2026-03-08T20:05:35+00:00" + }, + { + "name": "monolog/monolog", + "version": "3.10.0", + "source": { + "type": "git", + "url": "https://github.com/Seldaek/monolog.git", + "reference": "b321dd6749f0bf7189444158a3ce785cc16d69b0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/b321dd6749f0bf7189444158a3ce785cc16d69b0", + "reference": "b321dd6749f0bf7189444158a3ce785cc16d69b0", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "psr/log": "^2.0 || ^3.0" + }, + "provide": { + "psr/log-implementation": "3.0.0" + }, + "require-dev": { + "aws/aws-sdk-php": "^3.0", + "doctrine/couchdb": "~1.0@dev", + "elasticsearch/elasticsearch": "^7 || ^8", + "ext-json": "*", + "graylog2/gelf-php": "^1.4.2 || ^2.0", + "guzzlehttp/guzzle": "^7.4.5", + "guzzlehttp/psr7": "^2.2", + "mongodb/mongodb": "^1.8 || ^2.0", + "php-amqplib/php-amqplib": "~2.4 || ^3", + "php-console/php-console": "^3.1.8", + "phpstan/phpstan": "^2", + "phpstan/phpstan-deprecation-rules": "^2", + "phpstan/phpstan-strict-rules": "^2", + "phpunit/phpunit": "^10.5.17 || ^11.0.7", + "predis/predis": "^1.1 || ^2", + "rollbar/rollbar": "^4.0", + "ruflin/elastica": "^7 || ^8", + "symfony/mailer": "^5.4 || ^6", + "symfony/mime": "^5.4 || ^6" + }, + "suggest": { + "aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB", + "doctrine/couchdb": "Allow sending log messages to a CouchDB server", + "elasticsearch/elasticsearch": "Allow sending log messages to an Elasticsearch server via official client", + "ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)", + "ext-curl": "Required to send log messages using the IFTTTHandler, the LogglyHandler, the SendGridHandler, the SlackWebhookHandler or the TelegramBotHandler", + "ext-mbstring": "Allow to work properly with unicode symbols", + "ext-mongodb": "Allow sending log messages to a MongoDB server (via driver)", + "ext-openssl": "Required to send log messages using SSL", + "ext-sockets": "Allow sending log messages to a Syslog server (via UDP driver)", + "graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server", + "mongodb/mongodb": "Allow sending log messages to a MongoDB server (via library)", + "php-amqplib/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib", + "rollbar/rollbar": "Allow sending log messages to Rollbar", + "ruflin/elastica": "Allow sending log messages to an Elastic Search server" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Monolog\\": "src/Monolog" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "https://seld.be" + } + ], + "description": "Sends your logs to files, sockets, inboxes, databases and various web services", + "homepage": "https://github.com/Seldaek/monolog", + "keywords": [ + "log", + "logging", + "psr-3" + ], + "support": { + "issues": "https://github.com/Seldaek/monolog/issues", + "source": "https://github.com/Seldaek/monolog/tree/3.10.0" + }, + "funding": [ + { + "url": "https://github.com/Seldaek", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/monolog/monolog", + "type": "tidelift" + } + ], + "time": "2026-01-02T08:56:05+00:00" + }, + { + "name": "nesbot/carbon", + "version": "3.11.4", + "source": { + "type": "git", + "url": "https://github.com/CarbonPHP/carbon.git", + "reference": "e890471a3494740f7d9326d72ce6a8c559ffee60" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/CarbonPHP/carbon/zipball/e890471a3494740f7d9326d72ce6a8c559ffee60", + "reference": "e890471a3494740f7d9326d72ce6a8c559ffee60", + "shasum": "" + }, + "require": { + "carbonphp/carbon-doctrine-types": "<100.0", + "ext-json": "*", + "php": "^8.1", + "psr/clock": "^1.0", + "symfony/clock": "^6.3.12 || ^7.0 || ^8.0", + "symfony/polyfill-mbstring": "^1.0", + "symfony/translation": "^4.4.18 || ^5.2.1 || ^6.0 || ^7.0 || ^8.0" + }, + "provide": { + "psr/clock-implementation": "1.0" + }, + "require-dev": { + "doctrine/dbal": "^3.6.3 || ^4.0", + "doctrine/orm": "^2.15.2 || ^3.0", + "friendsofphp/php-cs-fixer": "^v3.87.1", + "kylekatarnls/multi-tester": "^2.5.3", + "phpmd/phpmd": "^2.15.0", + "phpstan/extension-installer": "^1.4.3", + "phpstan/phpstan": "^2.1.22", + "phpunit/phpunit": "^10.5.53", + "squizlabs/php_codesniffer": "^3.13.4 || ^4.0.0" + }, + "bin": [ + "bin/carbon" + ], + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Carbon\\Laravel\\ServiceProvider" + ] + }, + "phpstan": { + "includes": [ + "extension.neon" + ] + }, + "branch-alias": { + "dev-2.x": "2.x-dev", + "dev-master": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Carbon\\": "src/Carbon/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Brian Nesbitt", + "email": "brian@nesbot.com", + "homepage": "https://markido.com" + }, + { + "name": "kylekatarnls", + "homepage": "https://github.com/kylekatarnls" + } + ], + "description": "An API extension for DateTime that supports 281 different languages.", + "homepage": "https://carbonphp.github.io/carbon/", + "keywords": [ + "date", + "datetime", + "time" + ], + "support": { + "docs": "https://carbonphp.github.io/carbon/guide/getting-started/introduction.html", + "issues": "https://github.com/CarbonPHP/carbon/issues", + "source": "https://github.com/CarbonPHP/carbon" + }, + "funding": [ + { + "url": "https://github.com/sponsors/kylekatarnls", + "type": "github" + }, + { + "url": "https://opencollective.com/Carbon#sponsor", + "type": "opencollective" + }, + { + "url": "https://tidelift.com/subscription/pkg/packagist-nesbot-carbon?utm_source=packagist-nesbot-carbon&utm_medium=referral&utm_campaign=readme", + "type": "tidelift" + } + ], + "time": "2026-04-07T09:57:54+00:00" + }, + { + "name": "nette/schema", + "version": "v1.3.5", + "source": { + "type": "git", + "url": "https://github.com/nette/schema.git", + "reference": "f0ab1a3cda782dbc5da270d28545236aa80c4002" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nette/schema/zipball/f0ab1a3cda782dbc5da270d28545236aa80c4002", + "reference": "f0ab1a3cda782dbc5da270d28545236aa80c4002", + "shasum": "" + }, + "require": { + "nette/utils": "^4.0", + "php": "8.1 - 8.5" + }, + "require-dev": { + "nette/phpstan-rules": "^1.0", + "nette/tester": "^2.6", + "phpstan/extension-installer": "^1.4@stable", + "phpstan/phpstan": "^2.1.39@stable", + "tracy/tracy": "^2.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3-dev" + } + }, + "autoload": { + "psr-4": { + "Nette\\": "src" + }, + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause", + "GPL-2.0-only", + "GPL-3.0-only" + ], + "authors": [ + { + "name": "David Grudl", + "homepage": "https://davidgrudl.com" + }, + { + "name": "Nette Community", + "homepage": "https://nette.org/contributors" + } + ], + "description": "📐 Nette Schema: validating data structures against a given Schema.", + "homepage": "https://nette.org", + "keywords": [ + "config", + "nette" + ], + "support": { + "issues": "https://github.com/nette/schema/issues", + "source": "https://github.com/nette/schema/tree/v1.3.5" + }, + "time": "2026-02-23T03:47:12+00:00" + }, + { + "name": "nette/utils", + "version": "v4.1.4", + "source": { + "type": "git", + "url": "https://github.com/nette/utils.git", + "reference": "7da6c396d7ebe142bc857c20479d5e70a5e1aac7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nette/utils/zipball/7da6c396d7ebe142bc857c20479d5e70a5e1aac7", + "reference": "7da6c396d7ebe142bc857c20479d5e70a5e1aac7", + "shasum": "" + }, + "require": { + "php": "8.2 - 8.5" + }, + "conflict": { + "nette/finder": "<3", + "nette/schema": "<1.2.2" + }, + "require-dev": { + "jetbrains/phpstorm-attributes": "^1.2", + "nette/phpstan-rules": "^1.0", + "nette/tester": "^2.5", + "phpstan/extension-installer": "^1.4@stable", + "phpstan/phpstan": "^2.1@stable", + "tracy/tracy": "^2.9" + }, + "suggest": { + "ext-gd": "to use Image", + "ext-iconv": "to use Strings::webalize(), toAscii(), chr() and reverse()", + "ext-intl": "to use Strings::webalize(), toAscii(), normalize() and compare()", + "ext-json": "to use Nette\\Utils\\Json", + "ext-mbstring": "to use Strings::lower() etc...", + "ext-tokenizer": "to use Nette\\Utils\\Reflection::getUseStatements()" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.1-dev" + } + }, + "autoload": { + "psr-4": { + "Nette\\": "src" + }, + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause", + "GPL-2.0-only", + "GPL-3.0-only" + ], + "authors": [ + { + "name": "David Grudl", + "homepage": "https://davidgrudl.com" + }, + { + "name": "Nette Community", + "homepage": "https://nette.org/contributors" + } + ], + "description": "🛠 Nette Utils: lightweight utilities for string & array manipulation, image handling, safe JSON encoding/decoding, validation, slug or strong password generating etc.", + "homepage": "https://nette.org", + "keywords": [ + "array", + "core", + "datetime", + "images", + "json", + "nette", + "paginator", + "password", + "slugify", + "string", + "unicode", + "utf-8", + "utility", + "validation" + ], + "support": { + "issues": "https://github.com/nette/utils/issues", + "source": "https://github.com/nette/utils/tree/v4.1.4" + }, + "time": "2026-05-11T20:49:54+00:00" + }, + { + "name": "nikic/php-parser", + "version": "v5.7.0", + "source": { + "type": "git", + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "dca41cd15c2ac9d055ad70dbfd011130757d1f82" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/dca41cd15c2ac9d055ad70dbfd011130757d1f82", + "reference": "dca41cd15c2ac9d055ad70dbfd011130757d1f82", + "shasum": "" + }, + "require": { + "ext-ctype": "*", + "ext-json": "*", + "ext-tokenizer": "*", + "php": ">=7.4" + }, + "require-dev": { + "ircmaxell/php-yacc": "^0.0.7", + "phpunit/phpunit": "^9.0" + }, + "bin": [ + "bin/php-parse" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.x-dev" + } + }, + "autoload": { + "psr-4": { + "PhpParser\\": "lib/PhpParser" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Nikita Popov" + } + ], + "description": "A PHP parser written in PHP", + "keywords": [ + "parser", + "php" + ], + "support": { + "issues": "https://github.com/nikic/PHP-Parser/issues", + "source": "https://github.com/nikic/PHP-Parser/tree/v5.7.0" + }, + "time": "2025-12-06T11:56:16+00:00" + }, + { + "name": "nunomaduro/termwind", + "version": "v2.4.0", + "source": { + "type": "git", + "url": "https://github.com/nunomaduro/termwind.git", + "reference": "712a31b768f5daea284c2169a7d227031001b9a8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nunomaduro/termwind/zipball/712a31b768f5daea284c2169a7d227031001b9a8", + "reference": "712a31b768f5daea284c2169a7d227031001b9a8", + "shasum": "" + }, + "require": { + "ext-mbstring": "*", + "php": "^8.2", + "symfony/console": "^7.4.4 || ^8.0.4" + }, + "require-dev": { + "illuminate/console": "^11.47.0", + "laravel/pint": "^1.27.1", + "mockery/mockery": "^1.6.12", + "pestphp/pest": "^2.36.0 || ^3.8.4 || ^4.3.2", + "phpstan/phpstan": "^1.12.32", + "phpstan/phpstan-strict-rules": "^1.6.2", + "symfony/var-dumper": "^7.3.5 || ^8.0.4", + "thecodingmachine/phpstan-strict-rules": "^1.0.0" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Termwind\\Laravel\\TermwindServiceProvider" + ] + }, + "branch-alias": { + "dev-2.x": "2.x-dev" + } + }, + "autoload": { + "files": [ + "src/Functions.php" + ], + "psr-4": { + "Termwind\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nuno Maduro", + "email": "enunomaduro@gmail.com" + } + ], + "description": "It's like Tailwind CSS, but for the console.", + "keywords": [ + "cli", + "console", + "css", + "package", + "php", + "style" + ], + "support": { + "issues": "https://github.com/nunomaduro/termwind/issues", + "source": "https://github.com/nunomaduro/termwind/tree/v2.4.0" + }, + "funding": [ + { + "url": "https://www.paypal.com/paypalme/enunomaduro", + "type": "custom" + }, + { + "url": "https://github.com/nunomaduro", + "type": "github" + }, + { + "url": "https://github.com/xiCO2k", + "type": "github" + } + ], + "time": "2026-02-16T23:10:27+00:00" + }, + { + "name": "paragonie/constant_time_encoding", + "version": "v3.1.3", + "source": { + "type": "git", + "url": "https://github.com/paragonie/constant_time_encoding.git", + "reference": "d5b01a39b3415c2cd581d3bd3a3575c1ebbd8e77" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/paragonie/constant_time_encoding/zipball/d5b01a39b3415c2cd581d3bd3a3575c1ebbd8e77", + "reference": "d5b01a39b3415c2cd581d3bd3a3575c1ebbd8e77", + "shasum": "" + }, + "require": { + "php": "^8" + }, + "require-dev": { + "infection/infection": "^0", + "nikic/php-fuzzer": "^0", + "phpunit/phpunit": "^9|^10|^11", + "vimeo/psalm": "^4|^5|^6" + }, + "type": "library", + "autoload": { + "psr-4": { + "ParagonIE\\ConstantTime\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Paragon Initiative Enterprises", + "email": "security@paragonie.com", + "homepage": "https://paragonie.com", + "role": "Maintainer" + }, + { + "name": "Steve 'Sc00bz' Thomas", + "email": "steve@tobtu.com", + "homepage": "https://www.tobtu.com", + "role": "Original Developer" + } + ], + "description": "Constant-time Implementations of RFC 4648 Encoding (Base-64, Base-32, Base-16)", + "keywords": [ + "base16", + "base32", + "base32_decode", + "base32_encode", + "base64", + "base64_decode", + "base64_encode", + "bin2hex", + "encoding", + "hex", + "hex2bin", + "rfc4648" + ], + "support": { + "email": "info@paragonie.com", + "issues": "https://github.com/paragonie/constant_time_encoding/issues", + "source": "https://github.com/paragonie/constant_time_encoding" + }, + "time": "2025-09-24T15:06:41+00:00" + }, + { + "name": "paragonie/random_compat", + "version": "v9.99.100", + "source": { + "type": "git", + "url": "https://github.com/paragonie/random_compat.git", + "reference": "996434e5492cb4c3edcb9168db6fbb1359ef965a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/paragonie/random_compat/zipball/996434e5492cb4c3edcb9168db6fbb1359ef965a", + "reference": "996434e5492cb4c3edcb9168db6fbb1359ef965a", + "shasum": "" + }, + "require": { + "php": ">= 7" + }, + "require-dev": { + "phpunit/phpunit": "4.*|5.*", + "vimeo/psalm": "^1" + }, + "suggest": { + "ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes." + }, + "type": "library", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Paragon Initiative Enterprises", + "email": "security@paragonie.com", + "homepage": "https://paragonie.com" + } + ], + "description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7", + "keywords": [ + "csprng", + "polyfill", + "pseudorandom", + "random" + ], + "support": { + "email": "info@paragonie.com", + "issues": "https://github.com/paragonie/random_compat/issues", + "source": "https://github.com/paragonie/random_compat" + }, + "time": "2020-10-15T08:29:30+00:00" + }, + { + "name": "phpoption/phpoption", + "version": "1.9.5", + "source": { + "type": "git", + "url": "https://github.com/schmittjoh/php-option.git", + "reference": "75365b91986c2405cf5e1e012c5595cd487a98be" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/schmittjoh/php-option/zipball/75365b91986c2405cf5e1e012c5595cd487a98be", + "reference": "75365b91986c2405cf5e1e012c5595cd487a98be", + "shasum": "" + }, + "require": { + "php": "^7.2.5 || ^8.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.2", + "phpunit/phpunit": "^8.5.44 || ^9.6.25 || ^10.5.53 || ^11.5.34" + }, + "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + }, + "branch-alias": { + "dev-master": "1.9-dev" + } + }, + "autoload": { + "psr-4": { + "PhpOption\\": "src/PhpOption/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Johannes M. Schmitt", + "email": "schmittjoh@gmail.com", + "homepage": "https://github.com/schmittjoh" + }, + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + } + ], + "description": "Option Type for PHP", + "keywords": [ + "language", + "option", + "php", + "type" + ], + "support": { + "issues": "https://github.com/schmittjoh/php-option/issues", + "source": "https://github.com/schmittjoh/php-option/tree/1.9.5" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpoption/phpoption", + "type": "tidelift" + } + ], + "time": "2025-12-27T19:41:33+00:00" + }, + { + "name": "phpseclib/phpseclib", + "version": "3.0.52", + "source": { + "type": "git", + "url": "https://github.com/phpseclib/phpseclib.git", + "reference": "2adaefc83df2ec548558307690f376dd7d4f4fce" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/2adaefc83df2ec548558307690f376dd7d4f4fce", + "reference": "2adaefc83df2ec548558307690f376dd7d4f4fce", + "shasum": "" + }, + "require": { + "paragonie/constant_time_encoding": "^1|^2|^3", + "paragonie/random_compat": "^1.4|^2.0|^9.99.99", + "php": ">=5.6.1" + }, + "require-dev": { + "phpunit/phpunit": "*" + }, + "suggest": { + "ext-dom": "Install the DOM extension to load XML formatted public keys.", + "ext-gmp": "Install the GMP (GNU Multiple Precision) extension in order to speed up arbitrary precision integer arithmetic operations.", + "ext-libsodium": "SSH2/SFTP can make use of some algorithms provided by the libsodium-php extension.", + "ext-mcrypt": "Install the Mcrypt extension in order to speed up a few other cryptographic operations.", + "ext-openssl": "Install the OpenSSL extension in order to speed up a wide variety of cryptographic operations." + }, + "type": "library", + "autoload": { + "files": [ + "phpseclib/bootstrap.php" + ], + "psr-4": { + "phpseclib3\\": "phpseclib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jim Wigginton", + "email": "terrafrost@php.net", + "role": "Lead Developer" + }, + { + "name": "Patrick Monnerat", + "email": "pm@datasphere.ch", + "role": "Developer" + }, + { + "name": "Andreas Fischer", + "email": "bantu@phpbb.com", + "role": "Developer" + }, + { + "name": "Hans-Jürgen Petrich", + "email": "petrich@tronic-media.com", + "role": "Developer" + }, + { + "name": "Graham Campbell", + "email": "graham@alt-three.com", + "role": "Developer" + } + ], + "description": "PHP Secure Communications Library - Pure-PHP implementations of RSA, AES, SSH2, SFTP, X.509 etc.", + "homepage": "http://phpseclib.sourceforge.net", + "keywords": [ + "BigInteger", + "aes", + "asn.1", + "asn1", + "blowfish", + "crypto", + "cryptography", + "encryption", + "rsa", + "security", + "sftp", + "signature", + "signing", + "ssh", + "twofish", + "x.509", + "x509" + ], + "support": { + "issues": "https://github.com/phpseclib/phpseclib/issues", + "source": "https://github.com/phpseclib/phpseclib/tree/3.0.52" + }, + "funding": [ + { + "url": "https://github.com/terrafrost", + "type": "github" + }, + { + "url": "https://www.patreon.com/phpseclib", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpseclib/phpseclib", + "type": "tidelift" + } + ], + "time": "2026-04-27T07:02:15+00:00" + }, + { + "name": "psr/clock", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/clock.git", + "reference": "e41a24703d4560fd0acb709162f73b8adfc3aa0d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/clock/zipball/e41a24703d4560fd0acb709162f73b8adfc3aa0d", + "reference": "e41a24703d4560fd0acb709162f73b8adfc3aa0d", + "shasum": "" + }, + "require": { + "php": "^7.0 || ^8.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Psr\\Clock\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for reading the clock.", + "homepage": "https://github.com/php-fig/clock", + "keywords": [ + "clock", + "now", + "psr", + "psr-20", + "time" + ], + "support": { + "issues": "https://github.com/php-fig/clock/issues", + "source": "https://github.com/php-fig/clock/tree/1.0.0" + }, + "time": "2022-11-25T14:36:26+00:00" + }, + { + "name": "psr/container", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "shasum": "" + }, + "require": { + "php": ">=7.4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "support": { + "issues": "https://github.com/php-fig/container/issues", + "source": "https://github.com/php-fig/container/tree/2.0.2" + }, + "time": "2021-11-05T16:47:00+00:00" + }, + { + "name": "psr/event-dispatcher", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/event-dispatcher.git", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/event-dispatcher/zipball/dbefd12671e8a14ec7f180cab83036ed26714bb0", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0", + "shasum": "" + }, + "require": { + "php": ">=7.2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\EventDispatcher\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Standard interfaces for event handling.", + "keywords": [ + "events", + "psr", + "psr-14" + ], + "support": { + "issues": "https://github.com/php-fig/event-dispatcher/issues", + "source": "https://github.com/php-fig/event-dispatcher/tree/1.0.0" + }, + "time": "2019-01-08T18:20:26+00:00" + }, + { + "name": "psr/http-client", + "version": "1.0.3", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-client.git", + "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-client/zipball/bb5906edc1c324c9a05aa0873d40117941e5fa90", + "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90", + "shasum": "" + }, + "require": { + "php": "^7.0 || ^8.0", + "psr/http-message": "^1.0 || ^2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Client\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP clients", + "homepage": "https://github.com/php-fig/http-client", + "keywords": [ + "http", + "http-client", + "psr", + "psr-18" + ], + "support": { + "source": "https://github.com/php-fig/http-client" + }, + "time": "2023-09-23T14:17:50+00:00" + }, + { + "name": "psr/http-factory", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-factory.git", + "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-factory/zipball/2b4765fddfe3b508ac62f829e852b1501d3f6e8a", + "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a", + "shasum": "" + }, + "require": { + "php": ">=7.1", + "psr/http-message": "^1.0 || ^2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "PSR-17: Common interfaces for PSR-7 HTTP message factories", + "keywords": [ + "factory", + "http", + "message", + "psr", + "psr-17", + "psr-7", + "request", + "response" + ], + "support": { + "source": "https://github.com/php-fig/http-factory" + }, + "time": "2024-04-15T12:06:14+00:00" + }, + { + "name": "psr/http-message", + "version": "2.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-message.git", + "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/402d35bcb92c70c026d1a6a9883f06b2ead23d71", + "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP messages", + "homepage": "https://github.com/php-fig/http-message", + "keywords": [ + "http", + "http-message", + "psr", + "psr-7", + "request", + "response" + ], + "support": { + "source": "https://github.com/php-fig/http-message/tree/2.0" + }, + "time": "2023-04-04T09:54:51+00:00" + }, + { + "name": "psr/log", + "version": "3.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", + "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", + "shasum": "" + }, + "require": { + "php": ">=8.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "support": { + "source": "https://github.com/php-fig/log/tree/3.0.2" + }, + "time": "2024-09-11T13:17:53+00:00" + }, + { + "name": "psr/simple-cache", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/simple-cache.git", + "reference": "764e0b3939f5ca87cb904f570ef9be2d78a07865" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/764e0b3939f5ca87cb904f570ef9be2d78a07865", + "reference": "764e0b3939f5ca87cb904f570ef9be2d78a07865", + "shasum": "" + }, + "require": { + "php": ">=8.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\SimpleCache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interfaces for simple caching", + "keywords": [ + "cache", + "caching", + "psr", + "psr-16", + "simple-cache" + ], + "support": { + "source": "https://github.com/php-fig/simple-cache/tree/3.0.0" + }, + "time": "2021-10-29T13:26:27+00:00" + }, + { + "name": "psy/psysh", + "version": "v0.12.23", + "source": { + "type": "git", + "url": "https://github.com/bobthecow/psysh.git", + "reference": "4dcc0f08047d52bbde475eda481146fd8e27e1a4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/bobthecow/psysh/zipball/4dcc0f08047d52bbde475eda481146fd8e27e1a4", + "reference": "4dcc0f08047d52bbde475eda481146fd8e27e1a4", + "shasum": "" + }, + "require": { + "ext-json": "*", + "ext-tokenizer": "*", + "nikic/php-parser": "^5.0 || ^4.0", + "php": "^8.0 || ^7.4", + "symfony/console": "^8.0 || ^7.0 || ^6.0 || ^5.0 || ^4.0 || ^3.4", + "symfony/var-dumper": "^8.0 || ^7.0 || ^6.0 || ^5.0 || ^4.0 || ^3.4" + }, + "conflict": { + "symfony/console": "4.4.37 || 5.3.14 || 5.3.15 || 5.4.3 || 5.4.4 || 6.0.3 || 6.0.4" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.2", + "composer/class-map-generator": "^1.6" + }, + "suggest": { + "composer/class-map-generator": "Improved tab completion performance with better class discovery.", + "ext-pcntl": "Enabling the PCNTL extension makes PsySH a lot happier :)", + "ext-posix": "If you have PCNTL, you'll want the POSIX extension as well." + }, + "bin": [ + "bin/psysh" + ], + "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": false, + "forward-command": false + }, + "branch-alias": { + "dev-main": "0.12.x-dev" + } + }, + "autoload": { + "files": [ + "src/functions.php" + ], + "psr-4": { + "Psy\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Justin Hileman", + "email": "justin@justinhileman.info" + } + ], + "description": "An interactive shell for modern PHP.", + "homepage": "https://psysh.org", + "keywords": [ + "REPL", + "console", + "interactive", + "shell" + ], + "support": { + "issues": "https://github.com/bobthecow/psysh/issues", + "source": "https://github.com/bobthecow/psysh/tree/v0.12.23" + }, + "time": "2026-05-23T13:41:31+00:00" + }, + { + "name": "ralouphie/getallheaders", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/ralouphie/getallheaders.git", + "reference": "120b605dfeb996808c31b6477290a714d356e822" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", + "reference": "120b605dfeb996808c31b6477290a714d356e822", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "require-dev": { + "php-coveralls/php-coveralls": "^2.1", + "phpunit/phpunit": "^5 || ^6.5" + }, + "type": "library", + "autoload": { + "files": [ + "src/getallheaders.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ralph Khattar", + "email": "ralph.khattar@gmail.com" + } + ], + "description": "A polyfill for getallheaders.", + "support": { + "issues": "https://github.com/ralouphie/getallheaders/issues", + "source": "https://github.com/ralouphie/getallheaders/tree/develop" + }, + "time": "2019-03-08T08:55:37+00:00" + }, + { + "name": "ramsey/collection", + "version": "2.1.1", + "source": { + "type": "git", + "url": "https://github.com/ramsey/collection.git", + "reference": "344572933ad0181accbf4ba763e85a0306a8c5e2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ramsey/collection/zipball/344572933ad0181accbf4ba763e85a0306a8c5e2", + "reference": "344572933ad0181accbf4ba763e85a0306a8c5e2", + "shasum": "" + }, + "require": { + "php": "^8.1" + }, + "require-dev": { + "captainhook/plugin-composer": "^5.3", + "ergebnis/composer-normalize": "^2.45", + "fakerphp/faker": "^1.24", + "hamcrest/hamcrest-php": "^2.0", + "jangregor/phpstan-prophecy": "^2.1", + "mockery/mockery": "^1.6", + "php-parallel-lint/php-console-highlighter": "^1.0", + "php-parallel-lint/php-parallel-lint": "^1.4", + "phpspec/prophecy-phpunit": "^2.3", + "phpstan/extension-installer": "^1.4", + "phpstan/phpstan": "^2.1", + "phpstan/phpstan-mockery": "^2.0", + "phpstan/phpstan-phpunit": "^2.0", + "phpunit/phpunit": "^10.5", + "ramsey/coding-standard": "^2.3", + "ramsey/conventional-commits": "^1.6", + "roave/security-advisories": "dev-latest" + }, + "type": "library", + "extra": { + "captainhook": { + "force-install": true + }, + "ramsey/conventional-commits": { + "configFile": "conventional-commits.json" + } + }, + "autoload": { + "psr-4": { + "Ramsey\\Collection\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ben Ramsey", + "email": "ben@benramsey.com", + "homepage": "https://benramsey.com" + } + ], + "description": "A PHP library for representing and manipulating collections.", + "keywords": [ + "array", + "collection", + "hash", + "map", + "queue", + "set" + ], + "support": { + "issues": "https://github.com/ramsey/collection/issues", + "source": "https://github.com/ramsey/collection/tree/2.1.1" + }, + "time": "2025-03-22T05:38:12+00:00" + }, + { + "name": "ramsey/uuid", + "version": "4.9.2", + "source": { + "type": "git", + "url": "https://github.com/ramsey/uuid.git", + "reference": "8429c78ca35a09f27565311b98101e2826affde0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ramsey/uuid/zipball/8429c78ca35a09f27565311b98101e2826affde0", + "reference": "8429c78ca35a09f27565311b98101e2826affde0", + "shasum": "" + }, + "require": { + "brick/math": "^0.8.16 || ^0.9 || ^0.10 || ^0.11 || ^0.12 || ^0.13 || ^0.14", + "php": "^8.0", + "ramsey/collection": "^1.2 || ^2.0" + }, + "replace": { + "rhumsaa/uuid": "self.version" + }, + "require-dev": { + "captainhook/captainhook": "^5.25", + "captainhook/plugin-composer": "^5.3", + "dealerdirect/phpcodesniffer-composer-installer": "^1.0", + "ergebnis/composer-normalize": "^2.47", + "mockery/mockery": "^1.6", + "paragonie/random-lib": "^2", + "php-mock/php-mock": "^2.6", + "php-mock/php-mock-mockery": "^1.5", + "php-parallel-lint/php-parallel-lint": "^1.4.0", + "phpbench/phpbench": "^1.2.14", + "phpstan/extension-installer": "^1.4", + "phpstan/phpstan": "^2.1", + "phpstan/phpstan-mockery": "^2.0", + "phpstan/phpstan-phpunit": "^2.0", + "phpunit/phpunit": "^9.6", + "slevomat/coding-standard": "^8.18", + "squizlabs/php_codesniffer": "^3.13" + }, + "suggest": { + "ext-bcmath": "Enables faster math with arbitrary-precision integers using BCMath.", + "ext-gmp": "Enables faster math with arbitrary-precision integers using GMP.", + "ext-uuid": "Enables the use of PeclUuidTimeGenerator and PeclUuidRandomGenerator.", + "paragonie/random-lib": "Provides RandomLib for use with the RandomLibAdapter", + "ramsey/uuid-doctrine": "Allows the use of Ramsey\\Uuid\\Uuid as Doctrine field type." + }, + "type": "library", + "extra": { + "captainhook": { + "force-install": true + } + }, + "autoload": { + "files": [ + "src/functions.php" + ], + "psr-4": { + "Ramsey\\Uuid\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "A PHP library for generating and working with universally unique identifiers (UUIDs).", + "keywords": [ + "guid", + "identifier", + "uuid" + ], + "support": { + "issues": "https://github.com/ramsey/uuid/issues", + "source": "https://github.com/ramsey/uuid/tree/4.9.2" + }, + "time": "2025-12-14T04:43:48+00:00" + }, + { + "name": "symfony/clock", + "version": "v8.1.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/clock.git", + "reference": "701ef4de9705d6c32292ebee5e8044094a09fbf6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/clock/zipball/701ef4de9705d6c32292ebee5e8044094a09fbf6", + "reference": "701ef4de9705d6c32292ebee5e8044094a09fbf6", + "shasum": "" + }, + "require": { + "php": ">=8.4.1", + "psr/clock": "^1.0" + }, + "provide": { + "psr/clock-implementation": "1.0" + }, + "type": "library", + "autoload": { + "files": [ + "Resources/now.php" + ], + "psr-4": { + "Symfony\\Component\\Clock\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Decouples applications from the system clock", + "homepage": "https://symfony.com", + "keywords": [ + "clock", + "psr20", + "time" + ], + "support": { + "source": "https://github.com/symfony/clock/tree/v8.1.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-05-29T05:06:50+00:00" + }, + { + "name": "symfony/console", + "version": "v7.4.13", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "85095d2573eaefaf35e40b9513a9bf09f72cd217" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/85095d2573eaefaf35e40b9513a9bf09f72cd217", + "reference": "85095d2573eaefaf35e40b9513a9bf09f72cd217", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/deprecation-contracts": "^2.5|^3", + "symfony/polyfill-mbstring": "~1.0", + "symfony/service-contracts": "^2.5|^3", + "symfony/string": "^7.2|^8.0" + }, + "conflict": { + "symfony/dependency-injection": "<6.4", + "symfony/dotenv": "<6.4", + "symfony/event-dispatcher": "<6.4", + "symfony/lock": "<6.4", + "symfony/process": "<6.4" + }, + "provide": { + "psr/log-implementation": "1.0|2.0|3.0" + }, + "require-dev": { + "psr/log": "^1|^2|^3", + "symfony/config": "^6.4|^7.0|^8.0", + "symfony/dependency-injection": "^6.4|^7.0|^8.0", + "symfony/event-dispatcher": "^6.4|^7.0|^8.0", + "symfony/http-foundation": "^6.4|^7.0|^8.0", + "symfony/http-kernel": "^6.4|^7.0|^8.0", + "symfony/lock": "^6.4|^7.0|^8.0", + "symfony/messenger": "^6.4|^7.0|^8.0", + "symfony/process": "^6.4|^7.0|^8.0", + "symfony/stopwatch": "^6.4|^7.0|^8.0", + "symfony/var-dumper": "^6.4|^7.0|^8.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Eases the creation of beautiful and testable command line interfaces", + "homepage": "https://symfony.com", + "keywords": [ + "cli", + "command-line", + "console", + "terminal" + ], + "support": { + "source": "https://github.com/symfony/console/tree/v7.4.13" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-05-24T08:56:14+00:00" + }, + { + "name": "symfony/css-selector", + "version": "v8.1.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/css-selector.git", + "reference": "dc0e2be45c9b5588c82414f02ac574b4b986abcd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/dc0e2be45c9b5588c82414f02ac574b4b986abcd", + "reference": "dc0e2be45c9b5588c82414f02ac574b4b986abcd", + "shasum": "" + }, + "require": { + "php": ">=8.4.1" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\CssSelector\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Jean-François Simon", + "email": "jeanfrancois.simon@sensiolabs.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Converts CSS selectors to XPath expressions", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/css-selector/tree/v8.1.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-05-29T05:06:50+00:00" + }, + { + "name": "symfony/deprecation-contracts", + "version": "v3.7.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "50f59d1f3ca46d41ac911f97a78626b6756af35b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/50f59d1f3ca46d41ac911f97a78626b6756af35b", + "reference": "50f59d1f3ca46d41ac911f97a78626b6756af35b", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, + "branch-alias": { + "dev-main": "3.7-dev" + } + }, + "autoload": { + "files": [ + "function.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "A generic function and convention to trigger deprecation notices", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.7.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-04-13T15:52:40+00:00" + }, + { + "name": "symfony/error-handler", + "version": "v7.4.8", + "source": { + "type": "git", + "url": "https://github.com/symfony/error-handler.git", + "reference": "8dd79d8af777ee6cba2fd4d98da6ffb839f3c0fa" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/error-handler/zipball/8dd79d8af777ee6cba2fd4d98da6ffb839f3c0fa", + "reference": "8dd79d8af777ee6cba2fd4d98da6ffb839f3c0fa", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "psr/log": "^1|^2|^3", + "symfony/polyfill-php85": "^1.32", + "symfony/var-dumper": "^6.4|^7.0|^8.0" + }, + "conflict": { + "symfony/deprecation-contracts": "<2.5", + "symfony/http-kernel": "<6.4" + }, + "require-dev": { + "symfony/console": "^6.4|^7.0|^8.0", + "symfony/deprecation-contracts": "^2.5|^3", + "symfony/http-kernel": "^6.4|^7.0|^8.0", + "symfony/serializer": "^6.4|^7.0|^8.0", + "symfony/webpack-encore-bundle": "^1.0|^2.0" + }, + "bin": [ + "Resources/bin/patch-type-declarations" + ], + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\ErrorHandler\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides tools to manage errors and ease debugging PHP code", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/error-handler/tree/v7.4.8" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-03-24T13:12:05+00:00" + }, + { + "name": "symfony/event-dispatcher", + "version": "v8.1.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher.git", + "reference": "f249ae3f680958b6f1f9dd76e5747cf0695b4102" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/f249ae3f680958b6f1f9dd76e5747cf0695b4102", + "reference": "f249ae3f680958b6f1f9dd76e5747cf0695b4102", + "shasum": "" + }, + "require": { + "php": ">=8.4.1", + "symfony/deprecation-contracts": "^2.5|^3", + "symfony/event-dispatcher-contracts": "^2.5|^3" + }, + "conflict": { + "symfony/security-http": "<7.4", + "symfony/service-contracts": "<2.5" + }, + "provide": { + "psr/event-dispatcher-implementation": "1.0", + "symfony/event-dispatcher-implementation": "2.0|3.0" + }, + "require-dev": { + "psr/log": "^1|^2|^3", + "symfony/config": "^7.4|^8.0", + "symfony/dependency-injection": "^7.4|^8.0", + "symfony/error-handler": "^7.4|^8.0", + "symfony/expression-language": "^7.4|^8.0", + "symfony/framework-bundle": "^7.4|^8.0", + "symfony/http-foundation": "^7.4|^8.0", + "symfony/service-contracts": "^2.5|^3", + "symfony/stopwatch": "^7.4|^8.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\EventDispatcher\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/event-dispatcher/tree/v8.1.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-05-29T05:06:50+00:00" + }, + { + "name": "symfony/event-dispatcher-contracts", + "version": "v3.7.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher-contracts.git", + "reference": "ccba7060602b7fed0b03c85bf025257f76d9ef32" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/ccba7060602b7fed0b03c85bf025257f76d9ef32", + "reference": "ccba7060602b7fed0b03c85bf025257f76d9ef32", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "psr/event-dispatcher": "^1" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, + "branch-alias": { + "dev-main": "3.7-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\EventDispatcher\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to dispatching event", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.7.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-01-05T13:30:16+00:00" + }, + { + "name": "symfony/finder", + "version": "v7.4.8", + "source": { + "type": "git", + "url": "https://github.com/symfony/finder.git", + "reference": "e0be088d22278583a82da281886e8c3592fbf149" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/finder/zipball/e0be088d22278583a82da281886e8c3592fbf149", + "reference": "e0be088d22278583a82da281886e8c3592fbf149", + "shasum": "" + }, + "require": { + "php": ">=8.2" + }, + "require-dev": { + "symfony/filesystem": "^6.4|^7.0|^8.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Finder\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Finds files and directories via an intuitive fluent interface", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/finder/tree/v7.4.8" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-03-24T13:12:05+00:00" + }, + { + "name": "symfony/http-foundation", + "version": "v7.4.13", + "source": { + "type": "git", + "url": "https://github.com/symfony/http-foundation.git", + "reference": "bc354f47c62301e990b7874fa662326368508e2c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/bc354f47c62301e990b7874fa662326368508e2c", + "reference": "bc354f47c62301e990b7874fa662326368508e2c", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/deprecation-contracts": "^2.5|^3", + "symfony/polyfill-mbstring": "^1.1" + }, + "conflict": { + "doctrine/dbal": "<3.6", + "symfony/cache": "<6.4.12|>=7.0,<7.1.5" + }, + "require-dev": { + "doctrine/dbal": "^3.6|^4", + "predis/predis": "^1.1|^2.0", + "symfony/cache": "^6.4.12|^7.1.5|^8.0", + "symfony/clock": "^6.4|^7.0|^8.0", + "symfony/dependency-injection": "^6.4|^7.0|^8.0", + "symfony/expression-language": "^6.4|^7.0|^8.0", + "symfony/http-kernel": "^6.4|^7.0|^8.0", + "symfony/mime": "^6.4|^7.0|^8.0", + "symfony/rate-limiter": "^6.4|^7.0|^8.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\HttpFoundation\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Defines an object-oriented layer for the HTTP specification", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/http-foundation/tree/v7.4.13" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-05-24T11:20:33+00:00" + }, + { + "name": "symfony/http-kernel", + "version": "v7.4.13", + "source": { + "type": "git", + "url": "https://github.com/symfony/http-kernel.git", + "reference": "9df847980c436451f4f51d1284491bb4356dd989" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/9df847980c436451f4f51d1284491bb4356dd989", + "reference": "9df847980c436451f4f51d1284491bb4356dd989", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "psr/log": "^1|^2|^3", + "symfony/deprecation-contracts": "^2.5|^3", + "symfony/error-handler": "^6.4|^7.0|^8.0", + "symfony/event-dispatcher": "^7.3|^8.0", + "symfony/http-foundation": "^7.4|^8.0", + "symfony/polyfill-ctype": "^1.8" + }, + "conflict": { + "symfony/browser-kit": "<6.4", + "symfony/cache": "<6.4", + "symfony/config": "<6.4", + "symfony/console": "<6.4", + "symfony/dependency-injection": "<6.4", + "symfony/doctrine-bridge": "<6.4", + "symfony/flex": "<2.10", + "symfony/form": "<6.4", + "symfony/http-client": "<6.4", + "symfony/http-client-contracts": "<2.5", + "symfony/mailer": "<6.4", + "symfony/messenger": "<6.4", + "symfony/translation": "<6.4", + "symfony/translation-contracts": "<2.5", + "symfony/twig-bridge": "<6.4", + "symfony/validator": "<6.4", + "symfony/var-dumper": "<6.4", + "twig/twig": "<3.12" + }, + "provide": { + "psr/log-implementation": "1.0|2.0|3.0" + }, + "require-dev": { + "psr/cache": "^1.0|^2.0|^3.0", + "symfony/browser-kit": "^6.4|^7.0|^8.0", + "symfony/clock": "^6.4|^7.0|^8.0", + "symfony/config": "^6.4|^7.0|^8.0", + "symfony/console": "^6.4|^7.0|^8.0", + "symfony/css-selector": "^6.4|^7.0|^8.0", + "symfony/dependency-injection": "^6.4.1|^7.0.1|^8.0", + "symfony/dom-crawler": "^6.4|^7.0|^8.0", + "symfony/expression-language": "^6.4|^7.0|^8.0", + "symfony/finder": "^6.4|^7.0|^8.0", + "symfony/http-client-contracts": "^2.5|^3", + "symfony/process": "^6.4|^7.0|^8.0", + "symfony/property-access": "^7.1|^8.0", + "symfony/routing": "^6.4|^7.0|^8.0", + "symfony/serializer": "^7.1|^8.0", + "symfony/stopwatch": "^6.4|^7.0|^8.0", + "symfony/translation": "^6.4|^7.0|^8.0", + "symfony/translation-contracts": "^2.5|^3", + "symfony/uid": "^6.4|^7.0|^8.0", + "symfony/validator": "^6.4|^7.0|^8.0", + "symfony/var-dumper": "^6.4|^7.0|^8.0", + "symfony/var-exporter": "^6.4|^7.0|^8.0", + "twig/twig": "^3.12" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\HttpKernel\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides a structured process for converting a Request into a Response", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/http-kernel/tree/v7.4.13" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-05-27T08:31:43+00:00" + }, + { + "name": "symfony/mailer", + "version": "v7.4.12", + "source": { + "type": "git", + "url": "https://github.com/symfony/mailer.git", + "reference": "5cefb712a25f320579615ba9e1942abaeade7dff" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/mailer/zipball/5cefb712a25f320579615ba9e1942abaeade7dff", + "reference": "5cefb712a25f320579615ba9e1942abaeade7dff", + "shasum": "" + }, + "require": { + "egulias/email-validator": "^2.1.10|^3|^4", + "php": ">=8.2", + "psr/event-dispatcher": "^1", + "psr/log": "^1|^2|^3", + "symfony/event-dispatcher": "^6.4|^7.0|^8.0", + "symfony/mime": "^7.2|^8.0", + "symfony/service-contracts": "^2.5|^3" + }, + "conflict": { + "symfony/http-client-contracts": "<2.5", + "symfony/http-kernel": "<6.4", + "symfony/messenger": "<6.4", + "symfony/mime": "<6.4", + "symfony/twig-bridge": "<6.4" + }, + "require-dev": { + "symfony/console": "^6.4|^7.0|^8.0", + "symfony/http-client": "^6.4|^7.0|^8.0", + "symfony/messenger": "^6.4|^7.0|^8.0", + "symfony/twig-bridge": "^6.4|^7.0|^8.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Mailer\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Helps sending emails", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/mailer/tree/v7.4.12" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-05-20T07:20:23+00:00" + }, + { + "name": "symfony/mime", + "version": "v7.4.13", + "source": { + "type": "git", + "url": "https://github.com/symfony/mime.git", + "reference": "a845722765c4f6b2ce88beaf4f4479975b186770" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/mime/zipball/a845722765c4f6b2ce88beaf4f4479975b186770", + "reference": "a845722765c4f6b2ce88beaf4f4479975b186770", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/deprecation-contracts": "^2.5|^3", + "symfony/polyfill-intl-idn": "^1.10", + "symfony/polyfill-mbstring": "^1.0" + }, + "conflict": { + "egulias/email-validator": "~3.0.0", + "phpdocumentor/reflection-docblock": "<5.2|>=7", + "phpdocumentor/type-resolver": "<1.5.1", + "symfony/mailer": "<6.4", + "symfony/serializer": "<6.4.3|>7.0,<7.0.3" + }, + "require-dev": { + "egulias/email-validator": "^2.1.10|^3.1|^4", + "league/html-to-markdown": "^5.0", + "phpdocumentor/reflection-docblock": "^5.2|^6.0", + "symfony/dependency-injection": "^6.4|^7.0|^8.0", + "symfony/process": "^6.4|^7.0|^8.0", + "symfony/property-access": "^6.4|^7.0|^8.0", + "symfony/property-info": "^6.4|^7.0|^8.0", + "symfony/serializer": "^6.4.3|^7.0.3|^8.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Mime\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Allows manipulating MIME messages", + "homepage": "https://symfony.com", + "keywords": [ + "mime", + "mime-type" + ], + "support": { + "source": "https://github.com/symfony/mime/tree/v7.4.13" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-05-23T16:22:37+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.37.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "141046a8f9477948ff284fa65be2095baafb94f2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/141046a8f9477948ff284fa65be2095baafb94f2", + "reference": "141046a8f9477948ff284fa65be2095baafb94f2", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "provide": { + "ext-ctype": "*" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "support": { + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.37.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-04-10T16:19:22+00:00" + }, + { + "name": "symfony/polyfill-intl-grapheme", + "version": "v1.38.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-grapheme.git", + "reference": "e9247d281d694a5120554d9afaf54e070e88a603" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/e9247d281d694a5120554d9afaf54e070e88a603", + "reference": "e9247d281d694a5120554d9afaf54e070e88a603", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Grapheme\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's grapheme_* functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "grapheme", + "intl", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.38.1" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-05-26T05:58:03+00:00" + }, + { + "name": "symfony/polyfill-intl-idn", + "version": "v1.38.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-idn.git", + "reference": "dc21118016c039a66235cf93d96b435ffb282412" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/dc21118016c039a66235cf93d96b435ffb282412", + "reference": "dc21118016c039a66235cf93d96b435ffb282412", + "shasum": "" + }, + "require": { + "php": ">=7.2", + "symfony/polyfill-intl-normalizer": "^1.10" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Idn\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Laurent Bassin", + "email": "laurent@bassin.info" + }, + { + "name": "Trevor Rowbotham", + "email": "trevor.rowbotham@pm.me" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's idn_to_ascii and idn_to_utf8 functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "idn", + "intl", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.38.1" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-05-25T15:22:23+00:00" + }, + { + "name": "symfony/polyfill-intl-normalizer", + "version": "v1.38.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-normalizer.git", + "reference": "2d446c214bdbe5b71bde5011b060a05fece3ae6b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/2d446c214bdbe5b71bde5011b060a05fece3ae6b", + "reference": "2d446c214bdbe5b71bde5011b060a05fece3ae6b", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Normalizer\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's Normalizer class and related functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "intl", + "normalizer", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.38.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-05-25T13:48:31+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.38.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "14c5439eec4ccff081ac14eca2dc57feb2a66d92" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/14c5439eec4ccff081ac14eca2dc57feb2a66d92", + "reference": "14c5439eec4ccff081ac14eca2dc57feb2a66d92", + "shasum": "" + }, + "require": { + "ext-iconv": "*", + "php": ">=7.2" + }, + "provide": { + "ext-mbstring": "*" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.38.1" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-05-26T12:51:13+00:00" + }, + { + "name": "symfony/polyfill-php80", + "version": "v1.37.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "dfb55726c3a76ea3b6459fcfda1ec2d80a682411" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/dfb55726c3a76ea3b6459fcfda1ec2d80a682411", + "reference": "dfb55726c3a76ea3b6459fcfda1ec2d80a682411", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php80/tree/v1.37.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-04-10T16:19:22+00:00" + }, + { + "name": "symfony/polyfill-php83", + "version": "v1.38.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php83.git", + "reference": "8339098cae28673c15cce00d80734af0453054e2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php83/zipball/8339098cae28673c15cce00d80734af0453054e2", + "reference": "8339098cae28673c15cce00d80734af0453054e2", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php83\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.3+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php83/tree/v1.38.1" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-05-26T12:51:13+00:00" + }, + { + "name": "symfony/polyfill-php84", + "version": "v1.38.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php84.git", + "reference": "f4e1dfaee5b74aba5964fe1fd4dfc7ba5e3085fa" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php84/zipball/f4e1dfaee5b74aba5964fe1fd4dfc7ba5e3085fa", + "reference": "f4e1dfaee5b74aba5964fe1fd4dfc7ba5e3085fa", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php84\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.4+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php84/tree/v1.38.1" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-05-26T12:51:13+00:00" + }, + { + "name": "symfony/polyfill-php85", + "version": "v1.38.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php85.git", + "reference": "ba2ba04f3352cfa2dcbbcb90aee13ed967f505b1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php85/zipball/ba2ba04f3352cfa2dcbbcb90aee13ed967f505b1", + "reference": "ba2ba04f3352cfa2dcbbcb90aee13ed967f505b1", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php85\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.5+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php85/tree/v1.38.1" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-05-26T02:25:22+00:00" + }, + { + "name": "symfony/polyfill-uuid", + "version": "v1.37.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-uuid.git", + "reference": "26dfec253c4cf3e51b541b52ddf7e42cb0908e94" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-uuid/zipball/26dfec253c4cf3e51b541b52ddf7e42cb0908e94", + "reference": "26dfec253c4cf3e51b541b52ddf7e42cb0908e94", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "provide": { + "ext-uuid": "*" + }, + "suggest": { + "ext-uuid": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Uuid\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Grégoire Pineau", + "email": "lyrixx@lyrixx.info" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for uuid functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "uuid" + ], + "support": { + "source": "https://github.com/symfony/polyfill-uuid/tree/v1.37.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-04-10T16:19:22+00:00" + }, + { + "name": "symfony/process", + "version": "v7.4.13", + "source": { + "type": "git", + "url": "https://github.com/symfony/process.git", + "reference": "f5804be144caceb570f6747519999636b664f24c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/process/zipball/f5804be144caceb570f6747519999636b664f24c", + "reference": "f5804be144caceb570f6747519999636b664f24c", + "shasum": "" + }, + "require": { + "php": ">=8.2" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Process\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Executes commands in sub-processes", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/process/tree/v7.4.13" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-05-23T16:05:06+00:00" + }, + { + "name": "symfony/routing", + "version": "v7.4.13", + "source": { + "type": "git", + "url": "https://github.com/symfony/routing.git", + "reference": "3a162171bb008e5e0f15dce6581373a4c0e8390d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/routing/zipball/3a162171bb008e5e0f15dce6581373a4c0e8390d", + "reference": "3a162171bb008e5e0f15dce6581373a4c0e8390d", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/deprecation-contracts": "^2.5|^3" + }, + "conflict": { + "symfony/config": "<6.4", + "symfony/dependency-injection": "<6.4", + "symfony/yaml": "<6.4" + }, + "require-dev": { + "psr/log": "^1|^2|^3", + "symfony/config": "^6.4|^7.0|^8.0", + "symfony/dependency-injection": "^6.4|^7.0|^8.0", + "symfony/expression-language": "^6.4|^7.0|^8.0", + "symfony/http-foundation": "^6.4|^7.0|^8.0", + "symfony/yaml": "^6.4|^7.0|^8.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Routing\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Maps an HTTP request to a set of configuration variables", + "homepage": "https://symfony.com", + "keywords": [ + "router", + "routing", + "uri", + "url" + ], + "support": { + "source": "https://github.com/symfony/routing/tree/v7.4.13" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-05-24T11:20:33+00:00" + }, + { + "name": "symfony/service-contracts", + "version": "v3.7.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/service-contracts.git", + "reference": "d25d82433a80eba6aa0e6c24b61d7370d99e444a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/d25d82433a80eba6aa0e6c24b61d7370d99e444a", + "reference": "d25d82433a80eba6aa0e6c24b61d7370d99e444a", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "psr/container": "^1.1|^2.0", + "symfony/deprecation-contracts": "^2.5|^3" + }, + "conflict": { + "ext-psr": "<1.1|>=2" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, + "branch-alias": { + "dev-main": "3.7-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\Service\\": "" + }, + "exclude-from-classmap": [ + "/Test/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to writing services", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/service-contracts/tree/v3.7.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-03-28T09:44:51+00:00" + }, + { + "name": "symfony/string", + "version": "v8.1.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/string.git", + "reference": "afd5944f4005862d961efb85c8bbd5c523c4e3c9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/string/zipball/afd5944f4005862d961efb85c8bbd5c523c4e3c9", + "reference": "afd5944f4005862d961efb85c8bbd5c523c4e3c9", + "shasum": "" + }, + "require": { + "php": ">=8.4.1", + "symfony/polyfill-ctype": "^1.8", + "symfony/polyfill-intl-grapheme": "^1.33", + "symfony/polyfill-intl-normalizer": "^1.0", + "symfony/polyfill-mbstring": "^1.0" + }, + "conflict": { + "symfony/translation-contracts": "<2.5" + }, + "require-dev": { + "symfony/emoji": "^7.4|^8.0", + "symfony/http-client": "^7.4|^8.0", + "symfony/intl": "^7.4|^8.0", + "symfony/translation-contracts": "^2.5|^3.0", + "symfony/var-exporter": "^7.4|^8.0" + }, + "type": "library", + "autoload": { + "files": [ + "Resources/functions.php" + ], + "psr-4": { + "Symfony\\Component\\String\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way", + "homepage": "https://symfony.com", + "keywords": [ + "grapheme", + "i18n", + "string", + "unicode", + "utf-8", + "utf8" + ], + "support": { + "source": "https://github.com/symfony/string/tree/v8.1.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-05-29T05:06:50+00:00" + }, + { + "name": "symfony/translation", + "version": "v8.1.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/translation.git", + "reference": "b2bd012ca28c4acae830ee1206a5b6e35dd99693" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/translation/zipball/b2bd012ca28c4acae830ee1206a5b6e35dd99693", + "reference": "b2bd012ca28c4acae830ee1206a5b6e35dd99693", + "shasum": "" + }, + "require": { + "php": ">=8.4.1", + "symfony/polyfill-mbstring": "^1.0", + "symfony/translation-contracts": "^3.6.1" + }, + "conflict": { + "nikic/php-parser": "<5.0", + "symfony/http-client-contracts": "<2.5", + "symfony/service-contracts": "<2.5" + }, + "provide": { + "symfony/translation-implementation": "2.3|3.0" + }, + "require-dev": { + "nikic/php-parser": "^5.0", + "psr/log": "^1|^2|^3", + "symfony/config": "^7.4|^8.0", + "symfony/console": "^7.4|^8.0", + "symfony/dependency-injection": "^7.4|^8.0", + "symfony/finder": "^7.4|^8.0", + "symfony/http-client-contracts": "^2.5|^3.0", + "symfony/http-kernel": "^7.4|^8.0", + "symfony/intl": "^7.4|^8.0", + "symfony/polyfill-intl-icu": "^1.21", + "symfony/routing": "^7.4|^8.0", + "symfony/service-contracts": "^2.5|^3", + "symfony/yaml": "^7.4|^8.0" + }, + "type": "library", + "autoload": { + "files": [ + "Resources/functions.php" + ], + "psr-4": { + "Symfony\\Component\\Translation\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides tools to internationalize your application", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/translation/tree/v8.1.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-05-29T05:06:50+00:00" + }, + { + "name": "symfony/translation-contracts", + "version": "v3.7.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/translation-contracts.git", + "reference": "0ab302977a952b42fd51475c4ebac81f8da0a95d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/0ab302977a952b42fd51475c4ebac81f8da0a95d", + "reference": "0ab302977a952b42fd51475c4ebac81f8da0a95d", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, + "branch-alias": { + "dev-main": "3.7-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\Translation\\": "" + }, + "exclude-from-classmap": [ + "/Test/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to translation", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/translation-contracts/tree/v3.7.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-01-05T13:30:16+00:00" + }, + { + "name": "symfony/uid", + "version": "v7.4.9", + "source": { + "type": "git", + "url": "https://github.com/symfony/uid.git", + "reference": "2676b524340abcfe4d6151ec698463cebafee439" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/uid/zipball/2676b524340abcfe4d6151ec698463cebafee439", + "reference": "2676b524340abcfe4d6151ec698463cebafee439", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/polyfill-uuid": "^1.15" + }, + "require-dev": { + "symfony/console": "^6.4|^7.0|^8.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Uid\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Grégoire Pineau", + "email": "lyrixx@lyrixx.info" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides an object-oriented API to generate and represent UIDs", + "homepage": "https://symfony.com", + "keywords": [ + "UID", + "ulid", + "uuid" + ], + "support": { + "source": "https://github.com/symfony/uid/tree/v7.4.9" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-04-30T15:19:22+00:00" + }, + { + "name": "symfony/var-dumper", + "version": "v7.4.8", + "source": { + "type": "git", + "url": "https://github.com/symfony/var-dumper.git", + "reference": "9510c3966f749a1d1ff0059e1eabef6cc621e7fd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/9510c3966f749a1d1ff0059e1eabef6cc621e7fd", + "reference": "9510c3966f749a1d1ff0059e1eabef6cc621e7fd", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/deprecation-contracts": "^2.5|^3", + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "symfony/console": "<6.4" + }, + "require-dev": { + "symfony/console": "^6.4|^7.0|^8.0", + "symfony/http-kernel": "^6.4|^7.0|^8.0", + "symfony/process": "^6.4|^7.0|^8.0", + "symfony/uid": "^6.4|^7.0|^8.0", + "twig/twig": "^3.12" + }, + "bin": [ + "Resources/bin/var-dump-server" + ], + "type": "library", + "autoload": { + "files": [ + "Resources/functions/dump.php" + ], + "psr-4": { + "Symfony\\Component\\VarDumper\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides mechanisms for walking through any arbitrary PHP variable", + "homepage": "https://symfony.com", + "keywords": [ + "debug", + "dump" + ], + "support": { + "source": "https://github.com/symfony/var-dumper/tree/v7.4.8" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-03-30T13:44:50+00:00" + }, + { + "name": "tijsverkoyen/css-to-inline-styles", + "version": "v2.4.0", + "source": { + "type": "git", + "url": "https://github.com/tijsverkoyen/CssToInlineStyles.git", + "reference": "f0292ccf0ec75843d65027214426b6b163b48b41" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/tijsverkoyen/CssToInlineStyles/zipball/f0292ccf0ec75843d65027214426b6b163b48b41", + "reference": "f0292ccf0ec75843d65027214426b6b163b48b41", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-libxml": "*", + "php": "^7.4 || ^8.0", + "symfony/css-selector": "^5.4 || ^6.0 || ^7.0 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^2.0", + "phpstan/phpstan-phpunit": "^2.0", + "phpunit/phpunit": "^8.5.21 || ^9.5.10" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "autoload": { + "psr-4": { + "TijsVerkoyen\\CssToInlineStyles\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Tijs Verkoyen", + "email": "css_to_inline_styles@verkoyen.eu", + "role": "Developer" + } + ], + "description": "CssToInlineStyles is a class that enables you to convert HTML-pages/files into HTML-pages/files with inline styles. This is very useful when you're sending emails.", + "homepage": "https://github.com/tijsverkoyen/CssToInlineStyles", + "support": { + "issues": "https://github.com/tijsverkoyen/CssToInlineStyles/issues", + "source": "https://github.com/tijsverkoyen/CssToInlineStyles/tree/v2.4.0" + }, + "time": "2025-12-02T11:56:42+00:00" + }, + { + "name": "vlucas/phpdotenv", + "version": "v5.6.3", + "source": { + "type": "git", + "url": "https://github.com/vlucas/phpdotenv.git", + "reference": "955e7815d677a3eaa7075231212f2110983adecc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/955e7815d677a3eaa7075231212f2110983adecc", + "reference": "955e7815d677a3eaa7075231212f2110983adecc", + "shasum": "" + }, + "require": { + "ext-pcre": "*", + "graham-campbell/result-type": "^1.1.4", + "php": "^7.2.5 || ^8.0", + "phpoption/phpoption": "^1.9.5", + "symfony/polyfill-ctype": "^1.26", + "symfony/polyfill-mbstring": "^1.26", + "symfony/polyfill-php80": "^1.26" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.2", + "ext-filter": "*", + "phpunit/phpunit": "^8.5.34 || ^9.6.13 || ^10.4.2" + }, + "suggest": { + "ext-filter": "Required to use the boolean validator." + }, + "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + }, + "branch-alias": { + "dev-master": "5.6-dev" + } + }, + "autoload": { + "psr-4": { + "Dotenv\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Vance Lucas", + "email": "vance@vancelucas.com", + "homepage": "https://github.com/vlucas" + } + ], + "description": "Loads environment variables from `.env` to `getenv()`, `$_ENV` and `$_SERVER` automagically.", + "keywords": [ + "dotenv", + "env", + "environment" + ], + "support": { + "issues": "https://github.com/vlucas/phpdotenv/issues", + "source": "https://github.com/vlucas/phpdotenv/tree/v5.6.3" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/vlucas/phpdotenv", + "type": "tidelift" + } + ], + "time": "2025-12-27T19:49:13+00:00" + }, + { + "name": "voku/portable-ascii", + "version": "2.1.1", + "source": { + "type": "git", + "url": "https://github.com/voku/portable-ascii.git", + "reference": "8e1051fe39379367aecf014f41744ce7539a856f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/voku/portable-ascii/zipball/8e1051fe39379367aecf014f41744ce7539a856f", + "reference": "8e1051fe39379367aecf014f41744ce7539a856f", + "shasum": "" + }, + "require": { + "php": ">=7.1.0" + }, + "require-dev": { + "phpunit/phpunit": "~8.5 || ~9.6 || ~10.5 || ~11.5" + }, + "suggest": { + "ext-intl": "Use Intl for transliterator_transliterate() support" + }, + "type": "library", + "autoload": { + "psr-4": { + "voku\\": "src/voku/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Lars Moelleken", + "homepage": "https://www.moelleken.org/" + } + ], + "description": "Portable ASCII library - performance optimized (ascii) string functions for php.", + "homepage": "https://github.com/voku/portable-ascii", + "keywords": [ + "ascii", + "clean", + "php" + ], + "support": { + "issues": "https://github.com/voku/portable-ascii/issues", + "source": "https://github.com/voku/portable-ascii/tree/2.1.1" + }, + "funding": [ + { + "url": "https://www.paypal.me/moelleken", + "type": "custom" + }, + { + "url": "https://github.com/voku", + "type": "github" + }, + { + "url": "https://opencollective.com/portable-ascii", + "type": "open_collective" + }, + { + "url": "https://www.patreon.com/voku", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/voku/portable-ascii", + "type": "tidelift" + } + ], + "time": "2026-04-26T05:33:54+00:00" + } + ], + "packages-dev": [ + { + "name": "fakerphp/faker", + "version": "v1.24.1", + "source": { + "type": "git", + "url": "https://github.com/FakerPHP/Faker.git", + "reference": "e0ee18eb1e6dc3cda3ce9fd97e5a0689a88a64b5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/FakerPHP/Faker/zipball/e0ee18eb1e6dc3cda3ce9fd97e5a0689a88a64b5", + "reference": "e0ee18eb1e6dc3cda3ce9fd97e5a0689a88a64b5", + "shasum": "" + }, + "require": { + "php": "^7.4 || ^8.0", + "psr/container": "^1.0 || ^2.0", + "symfony/deprecation-contracts": "^2.2 || ^3.0" + }, + "conflict": { + "fzaninotto/faker": "*" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.4.1", + "doctrine/persistence": "^1.3 || ^2.0", + "ext-intl": "*", + "phpunit/phpunit": "^9.5.26", + "symfony/phpunit-bridge": "^5.4.16" + }, + "suggest": { + "doctrine/orm": "Required to use Faker\\ORM\\Doctrine", + "ext-curl": "Required by Faker\\Provider\\Image to download images.", + "ext-dom": "Required by Faker\\Provider\\HtmlLorem for generating random HTML.", + "ext-iconv": "Required by Faker\\Provider\\ru_RU\\Text::realText() for generating real Russian text.", + "ext-mbstring": "Required for multibyte Unicode string functionality." + }, + "type": "library", + "autoload": { + "psr-4": { + "Faker\\": "src/Faker/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "François Zaninotto" + } + ], + "description": "Faker is a PHP library that generates fake data for you.", + "keywords": [ + "data", + "faker", + "fixtures" + ], + "support": { + "issues": "https://github.com/FakerPHP/Faker/issues", + "source": "https://github.com/FakerPHP/Faker/tree/v1.24.1" + }, + "time": "2024-11-21T13:46:39+00:00" + }, + { + "name": "filp/whoops", + "version": "2.18.4", + "source": { + "type": "git", + "url": "https://github.com/filp/whoops.git", + "reference": "d2102955e48b9fd9ab24280a7ad12ed552752c4d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/filp/whoops/zipball/d2102955e48b9fd9ab24280a7ad12ed552752c4d", + "reference": "d2102955e48b9fd9ab24280a7ad12ed552752c4d", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0", + "psr/log": "^1.0.1 || ^2.0 || ^3.0" + }, + "require-dev": { + "mockery/mockery": "^1.0", + "phpunit/phpunit": "^7.5.20 || ^8.5.8 || ^9.3.3", + "symfony/var-dumper": "^4.0 || ^5.0" + }, + "suggest": { + "symfony/var-dumper": "Pretty print complex values better with var-dumper available", + "whoops/soap": "Formats errors as SOAP responses" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.7-dev" + } + }, + "autoload": { + "psr-4": { + "Whoops\\": "src/Whoops/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Filipe Dobreira", + "homepage": "https://github.com/filp", + "role": "Developer" + } + ], + "description": "php error handling for cool kids", + "homepage": "https://filp.github.io/whoops/", + "keywords": [ + "error", + "exception", + "handling", + "library", + "throwable", + "whoops" + ], + "support": { + "issues": "https://github.com/filp/whoops/issues", + "source": "https://github.com/filp/whoops/tree/2.18.4" + }, + "funding": [ + { + "url": "https://github.com/denis-sokolov", + "type": "github" + } + ], + "time": "2025-08-08T12:00:00+00:00" + }, + { + "name": "hamcrest/hamcrest-php", + "version": "v2.1.1", + "source": { + "type": "git", + "url": "https://github.com/hamcrest/hamcrest-php.git", + "reference": "f8b1c0173b22fa6ec77a81fe63e5b01eba7e6487" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/hamcrest/hamcrest-php/zipball/f8b1c0173b22fa6ec77a81fe63e5b01eba7e6487", + "reference": "f8b1c0173b22fa6ec77a81fe63e5b01eba7e6487", + "shasum": "" + }, + "require": { + "php": "^7.4|^8.0" + }, + "replace": { + "cordoval/hamcrest-php": "*", + "davedevelopment/hamcrest-php": "*", + "kodova/hamcrest-php": "*" + }, + "require-dev": { + "phpunit/php-file-iterator": "^1.4 || ^2.0 || ^3.0", + "phpunit/phpunit": "^4.8.36 || ^5.7 || ^6.5 || ^7.0 || ^8.0 || ^9.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.1-dev" + } + }, + "autoload": { + "classmap": [ + "hamcrest" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "This is the PHP port of Hamcrest Matchers", + "keywords": [ + "test" + ], + "support": { + "issues": "https://github.com/hamcrest/hamcrest-php/issues", + "source": "https://github.com/hamcrest/hamcrest-php/tree/v2.1.1" + }, + "time": "2025-04-30T06:54:44+00:00" + }, + { + "name": "laravel/pail", + "version": "v1.2.7", + "source": { + "type": "git", + "url": "https://github.com/laravel/pail.git", + "reference": "2f7d27dada8effc48b8c424445a69cca7007daaa" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laravel/pail/zipball/2f7d27dada8effc48b8c424445a69cca7007daaa", + "reference": "2f7d27dada8effc48b8c424445a69cca7007daaa", + "shasum": "" + }, + "require": { + "ext-mbstring": "*", + "illuminate/console": "^10.24|^11.0|^12.0|^13.0", + "illuminate/contracts": "^10.24|^11.0|^12.0|^13.0", + "illuminate/log": "^10.24|^11.0|^12.0|^13.0", + "illuminate/process": "^10.24|^11.0|^12.0|^13.0", + "illuminate/support": "^10.24|^11.0|^12.0|^13.0", + "nunomaduro/termwind": "^1.15|^2.0", + "php": "^8.2", + "symfony/console": "^6.0|^7.0|^8.0" + }, + "require-dev": { + "laravel/framework": "^10.24|^11.0|^12.0|^13.0", + "laravel/pint": "^1.13", + "orchestra/testbench-core": "^8.13|^9.17|^10.8|^11.0", + "pestphp/pest": "^2.20|^3.0|^4.0", + "pestphp/pest-plugin-type-coverage": "^2.3|^3.0|^4.0", + "phpstan/phpstan": "^1.12.27", + "symfony/var-dumper": "^6.3|^7.0|^8.0", + "symfony/yaml": "^6.3|^7.0|^8.0" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Laravel\\Pail\\PailServiceProvider" + ] + }, + "branch-alias": { + "dev-main": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Laravel\\Pail\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + }, + { + "name": "Nuno Maduro", + "email": "enunomaduro@gmail.com" + } + ], + "description": "Easily delve into your Laravel application's log files directly from the command line.", + "homepage": "https://github.com/laravel/pail", + "keywords": [ + "dev", + "laravel", + "logs", + "php", + "tail" + ], + "support": { + "issues": "https://github.com/laravel/pail/issues", + "source": "https://github.com/laravel/pail" + }, + "time": "2026-05-20T22:24:57+00:00" + }, + { + "name": "laravel/pint", + "version": "v1.29.1", + "source": { + "type": "git", + "url": "https://github.com/laravel/pint.git", + "reference": "0770e9b7fafd50d4586881d456d6eb41c9247a80" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laravel/pint/zipball/0770e9b7fafd50d4586881d456d6eb41c9247a80", + "reference": "0770e9b7fafd50d4586881d456d6eb41c9247a80", + "shasum": "" + }, + "require": { + "ext-json": "*", + "ext-mbstring": "*", + "ext-tokenizer": "*", + "ext-xml": "*", + "php": "^8.2.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^3.95.1", + "illuminate/view": "^12.56.0", + "larastan/larastan": "^3.9.6", + "laravel-zero/framework": "^12.1.0", + "mockery/mockery": "^1.6.12", + "nunomaduro/termwind": "^2.4.0", + "pestphp/pest": "^3.8.6", + "shipfastlabs/agent-detector": "^1.1.3" + }, + "bin": [ + "builds/pint" + ], + "type": "project", + "autoload": { + "psr-4": { + "App\\": "app/", + "Database\\Seeders\\": "database/seeders/", + "Database\\Factories\\": "database/factories/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nuno Maduro", + "email": "enunomaduro@gmail.com" + } + ], + "description": "An opinionated code formatter for PHP.", + "homepage": "https://laravel.com", + "keywords": [ + "dev", + "format", + "formatter", + "lint", + "linter", + "php" + ], + "support": { + "issues": "https://github.com/laravel/pint/issues", + "source": "https://github.com/laravel/pint" + }, + "time": "2026-04-20T15:26:14+00:00" + }, + { + "name": "laravel/sail", + "version": "v1.62.0", + "source": { + "type": "git", + "url": "https://github.com/laravel/sail.git", + "reference": "3aaeefc979f8ba6586fbc5b6e0b1b3638058f98e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laravel/sail/zipball/3aaeefc979f8ba6586fbc5b6e0b1b3638058f98e", + "reference": "3aaeefc979f8ba6586fbc5b6e0b1b3638058f98e", + "shasum": "" + }, + "require": { + "illuminate/console": "^9.52.16|^10.0|^11.0|^12.0|^13.0", + "illuminate/contracts": "^9.52.16|^10.0|^11.0|^12.0|^13.0", + "illuminate/support": "^9.52.16|^10.0|^11.0|^12.0|^13.0", + "php": "^8.0", + "symfony/console": "^6.0|^7.0|^8.0", + "symfony/yaml": "^6.0|^7.0|^8.0" + }, + "require-dev": { + "orchestra/testbench": "^7.0|^8.0|^9.0|^10.0|^11.0", + "phpstan/phpstan": "^2.0" + }, + "bin": [ + "bin/sail" + ], + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Laravel\\Sail\\SailServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "Laravel\\Sail\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "Docker files for running a basic Laravel application.", + "keywords": [ + "docker", + "laravel" + ], + "support": { + "issues": "https://github.com/laravel/sail/issues", + "source": "https://github.com/laravel/sail" + }, + "time": "2026-05-27T04:02:01+00:00" + }, + { + "name": "mockery/mockery", + "version": "1.6.12", + "source": { + "type": "git", + "url": "https://github.com/mockery/mockery.git", + "reference": "1f4efdd7d3beafe9807b08156dfcb176d18f1699" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/mockery/mockery/zipball/1f4efdd7d3beafe9807b08156dfcb176d18f1699", + "reference": "1f4efdd7d3beafe9807b08156dfcb176d18f1699", + "shasum": "" + }, + "require": { + "hamcrest/hamcrest-php": "^2.0.1", + "lib-pcre": ">=7.0", + "php": ">=7.3" + }, + "conflict": { + "phpunit/phpunit": "<8.0" + }, + "require-dev": { + "phpunit/phpunit": "^8.5 || ^9.6.17", + "symplify/easy-coding-standard": "^12.1.14" + }, + "type": "library", + "autoload": { + "files": [ + "library/helpers.php", + "library/Mockery.php" + ], + "psr-4": { + "Mockery\\": "library/Mockery" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Pádraic Brady", + "email": "padraic.brady@gmail.com", + "homepage": "https://github.com/padraic", + "role": "Author" + }, + { + "name": "Dave Marshall", + "email": "dave.marshall@atstsolutions.co.uk", + "homepage": "https://davedevelopment.co.uk", + "role": "Developer" + }, + { + "name": "Nathanael Esayeas", + "email": "nathanael.esayeas@protonmail.com", + "homepage": "https://github.com/ghostwriter", + "role": "Lead Developer" + } + ], + "description": "Mockery is a simple yet flexible PHP mock object framework", + "homepage": "https://github.com/mockery/mockery", + "keywords": [ + "BDD", + "TDD", + "library", + "mock", + "mock objects", + "mockery", + "stub", + "test", + "test double", + "testing" + ], + "support": { + "docs": "https://docs.mockery.io/", + "issues": "https://github.com/mockery/mockery/issues", + "rss": "https://github.com/mockery/mockery/releases.atom", + "security": "https://github.com/mockery/mockery/security/advisories", + "source": "https://github.com/mockery/mockery" + }, + "time": "2024-05-16T03:13:13+00:00" + }, + { + "name": "myclabs/deep-copy", + "version": "1.13.4", + "source": { + "type": "git", + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "07d290f0c47959fd5eed98c95ee5602db07e0b6a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/07d290f0c47959fd5eed98c95ee5602db07e0b6a", + "reference": "07d290f0c47959fd5eed98c95ee5602db07e0b6a", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "conflict": { + "doctrine/collections": "<1.6.8", + "doctrine/common": "<2.13.3 || >=3 <3.2.2" + }, + "require-dev": { + "doctrine/collections": "^1.6.8", + "doctrine/common": "^2.13.3 || ^3.2.2", + "phpspec/prophecy": "^1.10", + "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" + }, + "type": "library", + "autoload": { + "files": [ + "src/DeepCopy/deep_copy.php" + ], + "psr-4": { + "DeepCopy\\": "src/DeepCopy/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Create deep copies (clones) of your objects", + "keywords": [ + "clone", + "copy", + "duplicate", + "object", + "object graph" + ], + "support": { + "issues": "https://github.com/myclabs/DeepCopy/issues", + "source": "https://github.com/myclabs/DeepCopy/tree/1.13.4" + }, + "funding": [ + { + "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", + "type": "tidelift" + } + ], + "time": "2025-08-01T08:46:24+00:00" + }, + { + "name": "nunomaduro/collision", + "version": "v8.9.4", + "source": { + "type": "git", + "url": "https://github.com/nunomaduro/collision.git", + "reference": "716af8f95a470e9094cfca09ed897b023be191a5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nunomaduro/collision/zipball/716af8f95a470e9094cfca09ed897b023be191a5", + "reference": "716af8f95a470e9094cfca09ed897b023be191a5", + "shasum": "" + }, + "require": { + "filp/whoops": "^2.18.4", + "nunomaduro/termwind": "^2.4.0", + "php": "^8.2.0", + "symfony/console": "^7.4.8 || ^8.0.8" + }, + "conflict": { + "laravel/framework": "<11.48.0 || >=14.0.0", + "phpunit/phpunit": "<11.5.50 || >=14.0.0" + }, + "require-dev": { + "brianium/paratest": "^7.8.5", + "larastan/larastan": "^3.9.6", + "laravel/framework": "^11.48.0 || ^12.56.0 || ^13.5.0", + "laravel/pint": "^1.29.1", + "orchestra/testbench-core": "^9.12.0 || ^10.12.1 || ^11.2.1", + "pestphp/pest": "^3.8.5 || ^4.4.3 || ^5.0.0", + "sebastian/environment": "^7.2.1 || ^8.0.4 || ^9.3.0" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "NunoMaduro\\Collision\\Adapters\\Laravel\\CollisionServiceProvider" + ] + }, + "branch-alias": { + "dev-8.x": "8.x-dev" + } + }, + "autoload": { + "files": [ + "./src/Adapters/Phpunit/Autoload.php" + ], + "psr-4": { + "NunoMaduro\\Collision\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nuno Maduro", + "email": "enunomaduro@gmail.com" + } + ], + "description": "Cli error handling for console/command-line PHP applications.", + "keywords": [ + "artisan", + "cli", + "command-line", + "console", + "dev", + "error", + "handling", + "laravel", + "laravel-zero", + "php", + "symfony" + ], + "support": { + "issues": "https://github.com/nunomaduro/collision/issues", + "source": "https://github.com/nunomaduro/collision" + }, + "funding": [ + { + "url": "https://www.paypal.com/paypalme/enunomaduro", + "type": "custom" + }, + { + "url": "https://github.com/nunomaduro", + "type": "github" + }, + { + "url": "https://www.patreon.com/nunomaduro", + "type": "patreon" + } + ], + "time": "2026-04-21T14:04:20+00:00" + }, + { + "name": "phar-io/manifest", + "version": "2.0.4", + "source": { + "type": "git", + "url": "https://github.com/phar-io/manifest.git", + "reference": "54750ef60c58e43759730615a392c31c80e23176" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/54750ef60c58e43759730615a392c31c80e23176", + "reference": "54750ef60c58e43759730615a392c31c80e23176", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-libxml": "*", + "ext-phar": "*", + "ext-xmlwriter": "*", + "phar-io/version": "^3.0.1", + "php": "^7.2 || ^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", + "support": { + "issues": "https://github.com/phar-io/manifest/issues", + "source": "https://github.com/phar-io/manifest/tree/2.0.4" + }, + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], + "time": "2024-03-03T12:33:53+00:00" + }, + { + "name": "phar-io/version", + "version": "3.2.1", + "source": { + "type": "git", + "url": "https://github.com/phar-io/version.git", + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/version/zipball/4f7fd7836c6f332bb2933569e566a0d6c4cbed74", + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Library for handling version information and constraints", + "support": { + "issues": "https://github.com/phar-io/version/issues", + "source": "https://github.com/phar-io/version/tree/3.2.1" + }, + "time": "2022-02-21T01:04:05+00:00" + }, + { + "name": "phpunit/php-code-coverage", + "version": "11.0.12", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "2c1ed04922802c15e1de5d7447b4856de949cf56" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/2c1ed04922802c15e1de5d7447b4856de949cf56", + "reference": "2c1ed04922802c15e1de5d7447b4856de949cf56", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-libxml": "*", + "ext-xmlwriter": "*", + "nikic/php-parser": "^5.7.0", + "php": ">=8.2", + "phpunit/php-file-iterator": "^5.1.0", + "phpunit/php-text-template": "^4.0.1", + "sebastian/code-unit-reverse-lookup": "^4.0.1", + "sebastian/complexity": "^4.0.1", + "sebastian/environment": "^7.2.1", + "sebastian/lines-of-code": "^3.0.1", + "sebastian/version": "^5.0.2", + "theseer/tokenizer": "^1.3.1" + }, + "require-dev": { + "phpunit/phpunit": "^11.5.46" + }, + "suggest": { + "ext-pcov": "PHP extension that provides line coverage", + "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "11.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", + "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "keywords": [ + "coverage", + "testing", + "xunit" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", + "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/11.0.12" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpunit/php-code-coverage", + "type": "tidelift" + } + ], + "time": "2025-12-24T07:01:01+00:00" + }, + { + "name": "phpunit/php-file-iterator", + "version": "5.1.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "2f3a64888c814fc235386b7387dd5b5ed92ad903" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/2f3a64888c814fc235386b7387dd5b5ed92ad903", + "reference": "2f3a64888c814fc235386b7387dd5b5ed92ad903", + "shasum": "" + }, + "require": { + "php": ">=8.2" + }, + "require-dev": { + "phpunit/phpunit": "^11.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "5.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "FilterIterator implementation that filters files based on a list of suffixes.", + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "keywords": [ + "filesystem", + "iterator" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", + "security": "https://github.com/sebastianbergmann/php-file-iterator/security/policy", + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/5.1.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpunit/php-file-iterator", + "type": "tidelift" + } + ], + "time": "2026-02-02T13:52:54+00:00" + }, + { + "name": "phpunit/php-invoker", + "version": "5.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-invoker.git", + "reference": "c1ca3814734c07492b3d4c5f794f4b0995333da2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/c1ca3814734c07492b3d4c5f794f4b0995333da2", + "reference": "c1ca3814734c07492b3d4c5f794f4b0995333da2", + "shasum": "" + }, + "require": { + "php": ">=8.2" + }, + "require-dev": { + "ext-pcntl": "*", + "phpunit/phpunit": "^11.0" + }, + "suggest": { + "ext-pcntl": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "5.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Invoke callables with a timeout", + "homepage": "https://github.com/sebastianbergmann/php-invoker/", + "keywords": [ + "process" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-invoker/issues", + "security": "https://github.com/sebastianbergmann/php-invoker/security/policy", + "source": "https://github.com/sebastianbergmann/php-invoker/tree/5.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-07-03T05:07:44+00:00" + }, + { + "name": "phpunit/php-text-template", + "version": "4.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "3e0404dc6b300e6bf56415467ebcb3fe4f33e964" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/3e0404dc6b300e6bf56415467ebcb3fe4f33e964", + "reference": "3e0404dc6b300e6bf56415467ebcb3fe4f33e964", + "shasum": "" + }, + "require": { + "php": ">=8.2" + }, + "require-dev": { + "phpunit/phpunit": "^11.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "keywords": [ + "template" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-text-template/issues", + "security": "https://github.com/sebastianbergmann/php-text-template/security/policy", + "source": "https://github.com/sebastianbergmann/php-text-template/tree/4.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-07-03T05:08:43+00:00" + }, + { + "name": "phpunit/php-timer", + "version": "7.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "3b415def83fbcb41f991d9ebf16ae4ad8b7837b3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3b415def83fbcb41f991d9ebf16ae4ad8b7837b3", + "reference": "3b415def83fbcb41f991d9ebf16ae4ad8b7837b3", + "shasum": "" + }, + "require": { + "php": ">=8.2" + }, + "require-dev": { + "phpunit/phpunit": "^11.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "7.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-timer/issues", + "security": "https://github.com/sebastianbergmann/php-timer/security/policy", + "source": "https://github.com/sebastianbergmann/php-timer/tree/7.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-07-03T05:09:35+00:00" + }, + { + "name": "phpunit/phpunit", + "version": "11.5.55", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "adc7262fccc12de2b30f12a8aa0b33775d814f00" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/adc7262fccc12de2b30f12a8aa0b33775d814f00", + "reference": "adc7262fccc12de2b30f12a8aa0b33775d814f00", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", + "ext-xmlwriter": "*", + "myclabs/deep-copy": "^1.13.4", + "phar-io/manifest": "^2.0.4", + "phar-io/version": "^3.2.1", + "php": ">=8.2", + "phpunit/php-code-coverage": "^11.0.12", + "phpunit/php-file-iterator": "^5.1.1", + "phpunit/php-invoker": "^5.0.1", + "phpunit/php-text-template": "^4.0.1", + "phpunit/php-timer": "^7.0.1", + "sebastian/cli-parser": "^3.0.2", + "sebastian/code-unit": "^3.0.3", + "sebastian/comparator": "^6.3.3", + "sebastian/diff": "^6.0.2", + "sebastian/environment": "^7.2.1", + "sebastian/exporter": "^6.3.2", + "sebastian/global-state": "^7.0.2", + "sebastian/object-enumerator": "^6.0.1", + "sebastian/recursion-context": "^6.0.3", + "sebastian/type": "^5.1.3", + "sebastian/version": "^5.0.2", + "staabm/side-effects-detector": "^1.0.5" + }, + "suggest": { + "ext-soap": "To be able to generate mocks based on WSDL files" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "11.5-dev" + } + }, + "autoload": { + "files": [ + "src/Framework/Assert/Functions.php" + ], + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "The PHP Unit Testing framework.", + "homepage": "https://phpunit.de/", + "keywords": [ + "phpunit", + "testing", + "xunit" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/phpunit/issues", + "security": "https://github.com/sebastianbergmann/phpunit/security/policy", + "source": "https://github.com/sebastianbergmann/phpunit/tree/11.5.55" + }, + "funding": [ + { + "url": "https://phpunit.de/sponsors.html", + "type": "custom" + }, + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpunit/phpunit", + "type": "tidelift" + } + ], + "time": "2026-02-18T12:37:06+00:00" + }, + { + "name": "sebastian/cli-parser", + "version": "3.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/cli-parser.git", + "reference": "15c5dd40dc4f38794d383bb95465193f5e0ae180" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/15c5dd40dc4f38794d383bb95465193f5e0ae180", + "reference": "15c5dd40dc4f38794d383bb95465193f5e0ae180", + "shasum": "" + }, + "require": { + "php": ">=8.2" + }, + "require-dev": { + "phpunit/phpunit": "^11.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for parsing CLI options", + "homepage": "https://github.com/sebastianbergmann/cli-parser", + "support": { + "issues": "https://github.com/sebastianbergmann/cli-parser/issues", + "security": "https://github.com/sebastianbergmann/cli-parser/security/policy", + "source": "https://github.com/sebastianbergmann/cli-parser/tree/3.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-07-03T04:41:36+00:00" + }, + { + "name": "sebastian/code-unit", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit.git", + "reference": "54391c61e4af8078e5b276ab082b6d3c54c9ad64" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/54391c61e4af8078e5b276ab082b6d3c54c9ad64", + "reference": "54391c61e4af8078e5b276ab082b6d3c54c9ad64", + "shasum": "" + }, + "require": { + "php": ">=8.2" + }, + "require-dev": { + "phpunit/phpunit": "^11.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Collection of value objects that represent the PHP code units", + "homepage": "https://github.com/sebastianbergmann/code-unit", + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit/issues", + "security": "https://github.com/sebastianbergmann/code-unit/security/policy", + "source": "https://github.com/sebastianbergmann/code-unit/tree/3.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2025-03-19T07:56:08+00:00" + }, + { + "name": "sebastian/code-unit-reverse-lookup", + "version": "4.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "183a9b2632194febd219bb9246eee421dad8d45e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/183a9b2632194febd219bb9246eee421dad8d45e", + "reference": "183a9b2632194febd219bb9246eee421dad8d45e", + "shasum": "" + }, + "require": { + "php": ">=8.2" + }, + "require-dev": { + "phpunit/phpunit": "^11.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Looks up which function or method a line of code belongs to", + "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", + "security": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/security/policy", + "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/4.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-07-03T04:45:54+00:00" + }, + { + "name": "sebastian/comparator", + "version": "6.3.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "2c95e1e86cb8dd41beb8d502057d1081ccc8eca9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2c95e1e86cb8dd41beb8d502057d1081ccc8eca9", + "reference": "2c95e1e86cb8dd41beb8d502057d1081ccc8eca9", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-mbstring": "*", + "php": ">=8.2", + "sebastian/diff": "^6.0", + "sebastian/exporter": "^6.0" + }, + "require-dev": { + "phpunit/phpunit": "^11.4" + }, + "suggest": { + "ext-bcmath": "For comparing BcMath\\Number objects" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "6.3-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + } + ], + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "https://github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/comparator/issues", + "security": "https://github.com/sebastianbergmann/comparator/security/policy", + "source": "https://github.com/sebastianbergmann/comparator/tree/6.3.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/comparator", + "type": "tidelift" + } + ], + "time": "2026-01-24T09:26:40+00:00" + }, + { + "name": "sebastian/complexity", + "version": "4.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/complexity.git", + "reference": "ee41d384ab1906c68852636b6de493846e13e5a0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/ee41d384ab1906c68852636b6de493846e13e5a0", + "reference": "ee41d384ab1906c68852636b6de493846e13e5a0", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^5.0", + "php": ">=8.2" + }, + "require-dev": { + "phpunit/phpunit": "^11.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for calculating the complexity of PHP code units", + "homepage": "https://github.com/sebastianbergmann/complexity", + "support": { + "issues": "https://github.com/sebastianbergmann/complexity/issues", + "security": "https://github.com/sebastianbergmann/complexity/security/policy", + "source": "https://github.com/sebastianbergmann/complexity/tree/4.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-07-03T04:49:50+00:00" + }, + { + "name": "sebastian/diff", + "version": "6.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "b4ccd857127db5d41a5b676f24b51371d76d8544" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/b4ccd857127db5d41a5b676f24b51371d76d8544", + "reference": "b4ccd857127db5d41a5b676f24b51371d76d8544", + "shasum": "" + }, + "require": { + "php": ">=8.2" + }, + "require-dev": { + "phpunit/phpunit": "^11.0", + "symfony/process": "^4.2 || ^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "6.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + } + ], + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff", + "udiff", + "unidiff", + "unified diff" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/diff/issues", + "security": "https://github.com/sebastianbergmann/diff/security/policy", + "source": "https://github.com/sebastianbergmann/diff/tree/6.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-07-03T04:53:05+00:00" + }, + { + "name": "sebastian/environment", + "version": "7.2.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "a5c75038693ad2e8d4b6c15ba2403532647830c4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/a5c75038693ad2e8d4b6c15ba2403532647830c4", + "reference": "a5c75038693ad2e8d4b6c15ba2403532647830c4", + "shasum": "" + }, + "require": { + "php": ">=8.2" + }, + "require-dev": { + "phpunit/phpunit": "^11.3" + }, + "suggest": { + "ext-posix": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "7.2-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides functionality to handle HHVM/PHP environments", + "homepage": "https://github.com/sebastianbergmann/environment", + "keywords": [ + "Xdebug", + "environment", + "hhvm" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/environment/issues", + "security": "https://github.com/sebastianbergmann/environment/security/policy", + "source": "https://github.com/sebastianbergmann/environment/tree/7.2.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/environment", + "type": "tidelift" + } + ], + "time": "2025-05-21T11:55:47+00:00" + }, + { + "name": "sebastian/exporter", + "version": "6.3.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "70a298763b40b213ec087c51c739efcaa90bcd74" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/70a298763b40b213ec087c51c739efcaa90bcd74", + "reference": "70a298763b40b213ec087c51c739efcaa90bcd74", + "shasum": "" + }, + "require": { + "ext-mbstring": "*", + "php": ">=8.2", + "sebastian/recursion-context": "^6.0" + }, + "require-dev": { + "phpunit/phpunit": "^11.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "6.3-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Provides the functionality to export PHP variables for visualization", + "homepage": "https://www.github.com/sebastianbergmann/exporter", + "keywords": [ + "export", + "exporter" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/exporter/issues", + "security": "https://github.com/sebastianbergmann/exporter/security/policy", + "source": "https://github.com/sebastianbergmann/exporter/tree/6.3.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/exporter", + "type": "tidelift" + } + ], + "time": "2025-09-24T06:12:51+00:00" + }, + { + "name": "sebastian/global-state", + "version": "7.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "3be331570a721f9a4b5917f4209773de17f747d7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/3be331570a721f9a4b5917f4209773de17f747d7", + "reference": "3be331570a721f9a4b5917f4209773de17f747d7", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "sebastian/object-reflector": "^4.0", + "sebastian/recursion-context": "^6.0" + }, + "require-dev": { + "ext-dom": "*", + "phpunit/phpunit": "^11.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "7.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Snapshotting of global state", + "homepage": "https://www.github.com/sebastianbergmann/global-state", + "keywords": [ + "global state" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/global-state/issues", + "security": "https://github.com/sebastianbergmann/global-state/security/policy", + "source": "https://github.com/sebastianbergmann/global-state/tree/7.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-07-03T04:57:36+00:00" + }, + { + "name": "sebastian/lines-of-code", + "version": "3.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/lines-of-code.git", + "reference": "d36ad0d782e5756913e42ad87cb2890f4ffe467a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/d36ad0d782e5756913e42ad87cb2890f4ffe467a", + "reference": "d36ad0d782e5756913e42ad87cb2890f4ffe467a", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^5.0", + "php": ">=8.2" + }, + "require-dev": { + "phpunit/phpunit": "^11.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for counting the lines of code in PHP source code", + "homepage": "https://github.com/sebastianbergmann/lines-of-code", + "support": { + "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", + "security": "https://github.com/sebastianbergmann/lines-of-code/security/policy", + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/3.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-07-03T04:58:38+00:00" + }, + { + "name": "sebastian/object-enumerator", + "version": "6.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "f5b498e631a74204185071eb41f33f38d64608aa" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/f5b498e631a74204185071eb41f33f38d64608aa", + "reference": "f5b498e631a74204185071eb41f33f38d64608aa", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "sebastian/object-reflector": "^4.0", + "sebastian/recursion-context": "^6.0" + }, + "require-dev": { + "phpunit/phpunit": "^11.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "6.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Traverses array structures and object graphs to enumerate all referenced objects", + "homepage": "https://github.com/sebastianbergmann/object-enumerator/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", + "security": "https://github.com/sebastianbergmann/object-enumerator/security/policy", + "source": "https://github.com/sebastianbergmann/object-enumerator/tree/6.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-07-03T05:00:13+00:00" + }, + { + "name": "sebastian/object-reflector", + "version": "4.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-reflector.git", + "reference": "6e1a43b411b2ad34146dee7524cb13a068bb35f9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/6e1a43b411b2ad34146dee7524cb13a068bb35f9", + "reference": "6e1a43b411b2ad34146dee7524cb13a068bb35f9", + "shasum": "" + }, + "require": { + "php": ">=8.2" + }, + "require-dev": { + "phpunit/phpunit": "^11.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Allows reflection of object attributes, including inherited and non-public ones", + "homepage": "https://github.com/sebastianbergmann/object-reflector/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-reflector/issues", + "security": "https://github.com/sebastianbergmann/object-reflector/security/policy", + "source": "https://github.com/sebastianbergmann/object-reflector/tree/4.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-07-03T05:01:32+00:00" + }, + { + "name": "sebastian/recursion-context", + "version": "6.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "f6458abbf32a6c8174f8f26261475dc133b3d9dc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/f6458abbf32a6c8174f8f26261475dc133b3d9dc", + "reference": "f6458abbf32a6c8174f8f26261475dc133b3d9dc", + "shasum": "" + }, + "require": { + "php": ">=8.2" + }, + "require-dev": { + "phpunit/phpunit": "^11.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "6.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides functionality to recursively process PHP variables", + "homepage": "https://github.com/sebastianbergmann/recursion-context", + "support": { + "issues": "https://github.com/sebastianbergmann/recursion-context/issues", + "security": "https://github.com/sebastianbergmann/recursion-context/security/policy", + "source": "https://github.com/sebastianbergmann/recursion-context/tree/6.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/recursion-context", + "type": "tidelift" + } + ], + "time": "2025-08-13T04:42:22+00:00" + }, + { + "name": "sebastian/type", + "version": "5.1.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/type.git", + "reference": "f77d2d4e78738c98d9a68d2596fe5e8fa380f449" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/f77d2d4e78738c98d9a68d2596fe5e8fa380f449", + "reference": "f77d2d4e78738c98d9a68d2596fe5e8fa380f449", + "shasum": "" + }, + "require": { + "php": ">=8.2" + }, + "require-dev": { + "phpunit/phpunit": "^11.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "5.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Collection of value objects that represent the types of the PHP type system", + "homepage": "https://github.com/sebastianbergmann/type", + "support": { + "issues": "https://github.com/sebastianbergmann/type/issues", + "security": "https://github.com/sebastianbergmann/type/security/policy", + "source": "https://github.com/sebastianbergmann/type/tree/5.1.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/type", + "type": "tidelift" + } + ], + "time": "2025-08-09T06:55:48+00:00" + }, + { + "name": "sebastian/version", + "version": "5.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "c687e3387b99f5b03b6caa64c74b63e2936ff874" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c687e3387b99f5b03b6caa64c74b63e2936ff874", + "reference": "c687e3387b99f5b03b6caa64c74b63e2936ff874", + "shasum": "" + }, + "require": { + "php": ">=8.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "5.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version", + "support": { + "issues": "https://github.com/sebastianbergmann/version/issues", + "security": "https://github.com/sebastianbergmann/version/security/policy", + "source": "https://github.com/sebastianbergmann/version/tree/5.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-10-09T05:16:32+00:00" + }, + { + "name": "staabm/side-effects-detector", + "version": "1.0.5", + "source": { + "type": "git", + "url": "https://github.com/staabm/side-effects-detector.git", + "reference": "d8334211a140ce329c13726d4a715adbddd0a163" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/staabm/side-effects-detector/zipball/d8334211a140ce329c13726d4a715adbddd0a163", + "reference": "d8334211a140ce329c13726d4a715adbddd0a163", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": "^7.4 || ^8.0" + }, + "require-dev": { + "phpstan/extension-installer": "^1.4.3", + "phpstan/phpstan": "^1.12.6", + "phpunit/phpunit": "^9.6.21", + "symfony/var-dumper": "^5.4.43", + "tomasvotruba/type-coverage": "1.0.0", + "tomasvotruba/unused-public": "1.0.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "lib/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "A static analysis tool to detect side effects in PHP code", + "keywords": [ + "static analysis" + ], + "support": { + "issues": "https://github.com/staabm/side-effects-detector/issues", + "source": "https://github.com/staabm/side-effects-detector/tree/1.0.5" + }, + "funding": [ + { + "url": "https://github.com/staabm", + "type": "github" + } + ], + "time": "2024-10-20T05:08:20+00:00" + }, + { + "name": "symfony/yaml", + "version": "v8.1.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/yaml.git", + "reference": "efb42bd2c6f4f3ccfd4683583449938b5fc146b0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/yaml/zipball/efb42bd2c6f4f3ccfd4683583449938b5fc146b0", + "reference": "efb42bd2c6f4f3ccfd4683583449938b5fc146b0", + "shasum": "" + }, + "require": { + "php": ">=8.4.1", + "symfony/polyfill-ctype": "^1.8" + }, + "conflict": { + "symfony/console": "<7.4" + }, + "require-dev": { + "symfony/console": "^7.4|^8.0", + "yaml/yaml-test-suite": "*" + }, + "bin": [ + "Resources/bin/yaml-lint" + ], + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Yaml\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Loads and dumps YAML files", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/yaml/tree/v8.1.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-05-29T05:06:50+00:00" + }, + { + "name": "theseer/tokenizer", + "version": "1.3.1", + "source": { + "type": "git", + "url": "https://github.com/theseer/tokenizer.git", + "reference": "b7489ce515e168639d17feec34b8847c326b0b3c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/b7489ce515e168639d17feec34b8847c326b0b3c", + "reference": "b7489ce515e168639d17feec34b8847c326b0b3c", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": "^7.2 || ^8.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + } + ], + "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", + "support": { + "issues": "https://github.com/theseer/tokenizer/issues", + "source": "https://github.com/theseer/tokenizer/tree/1.3.1" + }, + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], + "time": "2025-11-17T20:03:58+00:00" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": {}, + "prefer-stable": true, + "prefer-lowest": false, + "platform": { + "php": "^8.2" + }, + "platform-dev": {}, + "plugin-api-version": "2.9.0" +} diff --git a/config/app.php b/config/app.php new file mode 100644 index 0000000..75e6921 --- /dev/null +++ b/config/app.php @@ -0,0 +1,132 @@ + env('APP_NAME', 'Ladill Care'), + + /* + |-------------------------------------------------------------------------- + | Application Environment + |-------------------------------------------------------------------------- + | + | This value determines the "environment" your application is currently + | running in. This may determine how you prefer to configure various + | services the application utilizes. Set this in your ".env" file. + | + */ + + 'env' => env('APP_ENV', 'production'), + + /* + |-------------------------------------------------------------------------- + | Application Debug Mode + |-------------------------------------------------------------------------- + | + | When your application is in debug mode, detailed error messages with + | stack traces will be shown on every error that occurs within your + | application. If disabled, a simple generic error page is shown. + | + */ + + 'debug' => (bool) env('APP_DEBUG', false), + + /* + |-------------------------------------------------------------------------- + | Application URL + |-------------------------------------------------------------------------- + | + | This URL is used by the console to properly generate URLs when using + | the Artisan command line tool. You should set this to the root of + | the application so that it's available within Artisan commands. + | + */ + + 'url' => env('APP_URL', 'http://localhost'), + + /* + |-------------------------------------------------------------------------- + | Application Timezone + |-------------------------------------------------------------------------- + | + | Here you may specify the default timezone for your application, which + | will be used by the PHP date and date-time functions. The timezone + | is set to "UTC" by default as it is suitable for most use cases. + | + */ + + 'timezone' => 'UTC', + + /* + |-------------------------------------------------------------------------- + | Application Locale Configuration + |-------------------------------------------------------------------------- + | + | The application locale determines the default locale that will be used + | by Laravel's translation / localization methods. This option can be + | set to any locale for which you plan to have translation strings. + | + */ + + 'locale' => env('APP_LOCALE', 'en'), + + 'fallback_locale' => env('APP_FALLBACK_LOCALE', 'en'), + + 'faker_locale' => env('APP_FAKER_LOCALE', 'en_US'), + + /* + |-------------------------------------------------------------------------- + | Encryption Key + |-------------------------------------------------------------------------- + | + | This key is utilized by Laravel's encryption services and should be set + | to a random, 32 character string to ensure that all encrypted values + | are secure. You should do this prior to deploying the application. + | + */ + + 'cipher' => 'AES-256-CBC', + + 'key' => env('APP_KEY'), + + 'previous_keys' => [ + ...array_filter( + explode(',', (string) env('APP_PREVIOUS_KEYS', '')) + ), + ], + + /* + |-------------------------------------------------------------------------- + | Maintenance Mode Driver + |-------------------------------------------------------------------------- + | + | These configuration options determine the driver used to determine and + | manage Laravel's "maintenance mode" status. The "cache" driver will + | allow maintenance mode to be controlled across multiple machines. + | + | Supported drivers: "file", "cache" + | + */ + + 'maintenance' => [ + 'driver' => env('APP_MAINTENANCE_DRIVER', 'file'), + 'store' => env('APP_MAINTENANCE_STORE', 'database'), + ], + + // Platform identity surfaces (Zoho One model). Ladill Care (care.ladill.com). + 'platform_domain' => env('PLATFORM_DOMAIN', parse_url((string) env('PLATFORM_URL', 'https://ladill.com'), PHP_URL_HOST) ?: 'ladill.com'), + 'auth_domain' => env('AUTH_DOMAIN', 'auth.'.(parse_url((string) env('PLATFORM_URL', 'https://ladill.com'), PHP_URL_HOST) ?: 'ladill.com')), + 'account_domain' => env('ACCOUNT_DOMAIN', 'account.'.(parse_url((string) env('PLATFORM_URL', 'https://ladill.com'), PHP_URL_HOST) ?: 'ladill.com')), + 'care_domain' => env('CARE_DOMAIN', parse_url((string) env('APP_URL', 'https://care.ladill.com'), PHP_URL_HOST) ?: 'care.ladill.com'), + +]; diff --git a/config/arkesel.php b/config/arkesel.php new file mode 100644 index 0000000..b2dca9c --- /dev/null +++ b/config/arkesel.php @@ -0,0 +1,13 @@ + env('ARKESEL_API_KEY', ''), + 'sender_id' => env('ARKESEL_SENDER_ID', 'Ladill'), + 'base_url' => env('ARKESEL_BASE_URL', 'https://sms.arkesel.com'), + + // Default country code for normalising local numbers to E.164-without-plus. + 'default_country_code' => env('SMS_DEFAULT_COUNTRY_CODE', '233'), +]; diff --git a/config/auth.php b/config/auth.php new file mode 100644 index 0000000..d7568ff --- /dev/null +++ b/config/auth.php @@ -0,0 +1,117 @@ + [ + 'guard' => env('AUTH_GUARD', 'web'), + 'passwords' => env('AUTH_PASSWORD_BROKER', 'users'), + ], + + /* + |-------------------------------------------------------------------------- + | Authentication Guards + |-------------------------------------------------------------------------- + | + | Next, you may define every authentication guard for your application. + | Of course, a great default configuration has been defined for you + | which utilizes session storage plus the Eloquent user provider. + | + | All authentication guards have a user provider, which defines how the + | users are actually retrieved out of your database or other storage + | system used by the application. Typically, Eloquent is utilized. + | + | Supported: "session" + | + */ + + 'guards' => [ + 'web' => [ + 'driver' => 'session', + 'provider' => 'users', + ], + ], + + /* + |-------------------------------------------------------------------------- + | User Providers + |-------------------------------------------------------------------------- + | + | All authentication guards have a user provider, which defines how the + | users are actually retrieved out of your database or other storage + | system used by the application. Typically, Eloquent is utilized. + | + | If you have multiple user tables or models you may configure multiple + | providers to represent the model / table. These providers may then + | be assigned to any extra authentication guards you have defined. + | + | Supported: "database", "eloquent" + | + */ + + 'providers' => [ + 'users' => [ + 'driver' => 'eloquent', + 'model' => env('AUTH_MODEL', User::class), + ], + + // 'users' => [ + // 'driver' => 'database', + // 'table' => 'users', + // ], + ], + + /* + |-------------------------------------------------------------------------- + | Resetting Passwords + |-------------------------------------------------------------------------- + | + | These configuration options specify the behavior of Laravel's password + | reset functionality, including the table utilized for token storage + | and the user provider that is invoked to actually retrieve users. + | + | The expiry time is the number of minutes that each reset token will be + | considered valid. This security feature keeps tokens short-lived so + | they have less time to be guessed. You may change this as needed. + | + | The throttle setting is the number of seconds a user must wait before + | generating more password reset tokens. This prevents the user from + | quickly generating a very large amount of password reset tokens. + | + */ + + 'passwords' => [ + 'users' => [ + 'provider' => 'users', + 'table' => env('AUTH_PASSWORD_RESET_TOKEN_TABLE', 'password_reset_tokens'), + 'expire' => 60, + 'throttle' => 60, + ], + ], + + /* + |-------------------------------------------------------------------------- + | Password Confirmation Timeout + |-------------------------------------------------------------------------- + | + | Here you may define the number of seconds before a password confirmation + | window expires and users are asked to re-enter their password via the + | confirmation screen. By default, the timeout lasts for three hours. + | + */ + + 'password_timeout' => env('AUTH_PASSWORD_TIMEOUT', 10800), + +]; diff --git a/config/billing.php b/config/billing.php new file mode 100644 index 0000000..d3290ad --- /dev/null +++ b/config/billing.php @@ -0,0 +1,9 @@ + env('BILLING_API_URL', 'https://ladill.com/api/billing'), + 'api_key' => env('BILLING_API_KEY_CARE'), + 'service' => 'care', + 'wallet_balance_route' => 'care.wallet', + 'currency' => 'GHS', +]; diff --git a/config/cache.php b/config/cache.php new file mode 100644 index 0000000..b32aead --- /dev/null +++ b/config/cache.php @@ -0,0 +1,117 @@ + env('CACHE_STORE', 'database'), + + /* + |-------------------------------------------------------------------------- + | Cache Stores + |-------------------------------------------------------------------------- + | + | Here you may define all of the cache "stores" for your application as + | well as their drivers. You may even define multiple stores for the + | same cache driver to group types of items stored in your caches. + | + | Supported drivers: "array", "database", "file", "memcached", + | "redis", "dynamodb", "octane", + | "failover", "null" + | + */ + + 'stores' => [ + + 'array' => [ + 'driver' => 'array', + 'serialize' => false, + ], + + 'database' => [ + 'driver' => 'database', + 'connection' => env('DB_CACHE_CONNECTION'), + 'table' => env('DB_CACHE_TABLE', 'cache'), + 'lock_connection' => env('DB_CACHE_LOCK_CONNECTION'), + 'lock_table' => env('DB_CACHE_LOCK_TABLE'), + ], + + 'file' => [ + 'driver' => 'file', + 'path' => storage_path('framework/cache/data'), + 'lock_path' => storage_path('framework/cache/data'), + ], + + 'memcached' => [ + 'driver' => 'memcached', + 'persistent_id' => env('MEMCACHED_PERSISTENT_ID'), + 'sasl' => [ + env('MEMCACHED_USERNAME'), + env('MEMCACHED_PASSWORD'), + ], + 'options' => [ + // Memcached::OPT_CONNECT_TIMEOUT => 2000, + ], + 'servers' => [ + [ + 'host' => env('MEMCACHED_HOST', '127.0.0.1'), + 'port' => env('MEMCACHED_PORT', 11211), + 'weight' => 100, + ], + ], + ], + + 'redis' => [ + 'driver' => 'redis', + 'connection' => env('REDIS_CACHE_CONNECTION', 'cache'), + 'lock_connection' => env('REDIS_CACHE_LOCK_CONNECTION', 'default'), + ], + + 'dynamodb' => [ + 'driver' => 'dynamodb', + 'key' => env('AWS_ACCESS_KEY_ID'), + 'secret' => env('AWS_SECRET_ACCESS_KEY'), + 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), + 'table' => env('DYNAMODB_CACHE_TABLE', 'cache'), + 'endpoint' => env('DYNAMODB_ENDPOINT'), + ], + + 'octane' => [ + 'driver' => 'octane', + ], + + 'failover' => [ + 'driver' => 'failover', + 'stores' => [ + 'database', + 'array', + ], + ], + + ], + + /* + |-------------------------------------------------------------------------- + | Cache Key Prefix + |-------------------------------------------------------------------------- + | + | When utilizing the APC, database, memcached, Redis, and DynamoDB cache + | stores, there might be other applications using the same cache. For + | that reason, you may prefix every cache key to avoid collisions. + | + */ + + 'prefix' => env('CACHE_PREFIX', Str::slug((string) env('APP_NAME', 'laravel')).'-cache-'), + +]; diff --git a/config/care.php b/config/care.php new file mode 100644 index 0000000..99bb7bc --- /dev/null +++ b/config/care.php @@ -0,0 +1,220 @@ + [ + 'super_admin' => 'Super Administrator', + 'hospital_admin' => 'Hospital Administrator', + 'receptionist' => 'Receptionist', + 'doctor' => 'Doctor', + 'nurse' => 'Nurse', + 'lab_technician' => 'Laboratory Technician', + 'pharmacist' => 'Pharmacist', + 'cashier' => 'Cashier', + 'accountant' => 'Accountant', + ], + + 'department_types' => [ + 'general' => 'General', + 'outpatient' => 'Outpatient', + 'emergency' => 'Emergency', + 'laboratory' => 'Laboratory', + 'radiology' => 'Radiology', + 'pharmacy' => 'Pharmacy', + 'maternity' => 'Maternity', + 'dental' => 'Dental', + 'physiotherapy' => 'Physiotherapy', + ], + + 'audit_actions' => [ + 'organization.created' => 'Organization created', + 'organization.updated' => 'Organization updated', + 'branch.created' => 'Branch created', + 'branch.updated' => 'Branch updated', + 'department.created' => 'Department created', + 'department.updated' => 'Department updated', + 'department.deleted' => 'Department deleted', + 'member.created' => 'Member added', + 'member.updated' => 'Member updated', + 'member.deleted' => 'Member removed', + 'patient.created' => 'Patient registered', + 'patient.updated' => 'Patient record updated', + 'patient.deleted' => 'Patient record archived', + 'appointment.created' => 'Appointment booked', + 'appointment.walk_in' => 'Walk-in registered', + 'appointment.checked_in' => 'Patient checked in', + 'appointment.waiting' => 'Patient added to queue', + 'appointment.in_consultation' => 'Consultation started', + 'appointment.completed' => 'Appointment completed', + 'appointment.cancelled' => 'Appointment cancelled', + 'appointment.no_show' => 'Patient marked no-show', + 'visit.checked_in' => 'Visit opened', + 'visit.completed' => 'Visit completed', + 'consultation.started' => 'Consultation started', + 'consultation.updated' => 'Consultation updated', + 'consultation.completed' => 'Consultation completed', + 'investigation.requested' => 'Investigation requested', + 'investigation.sample_collected' => 'Sample collected', + 'investigation.in_progress' => 'Investigation in progress', + 'investigation.results_entered' => 'Investigation results entered', + 'investigation.approved' => 'Investigation results approved', + 'investigation.delivered' => 'Investigation results delivered', + 'investigation.cancelled' => 'Investigation cancelled', + 'investigation_type.created' => 'Investigation type created', + 'investigation_type.updated' => 'Investigation type updated', + 'prescription.created' => 'Prescription created', + 'prescription.updated' => 'Prescription updated', + 'prescription.activated' => 'Prescription activated', + 'prescription.dispensed' => 'Prescription dispensed', + 'prescription.cancelled' => 'Prescription cancelled', + 'bill.created' => 'Bill created', + 'bill.updated' => 'Bill updated', + 'bill.line_item_added' => 'Bill line item added', + 'bill.voided' => 'Bill voided', + 'payment.recorded' => 'Payment recorded', + 'drug.created' => 'Drug added', + 'drug.updated' => 'Drug updated', + 'drug.batch_received' => 'Drug stock received', + ], + + 'appointment_statuses' => [ + 'scheduled' => 'Scheduled', + 'checked_in' => 'Checked in', + 'waiting' => 'Waiting', + 'in_consultation' => 'In consultation', + 'completed' => 'Completed', + 'cancelled' => 'Cancelled', + 'no_show' => 'No show', + ], + + 'visit_statuses' => [ + 'open' => 'Open', + 'in_progress' => 'In progress', + 'completed' => 'Completed', + ], + + 'consultation_statuses' => [ + 'draft' => 'Draft', + 'completed' => 'Completed', + ], + + 'investigation_categories' => [ + 'blood' => 'Blood', + 'urine' => 'Urine', + 'stool' => 'Stool', + 'xray' => 'X-Ray', + 'ultrasound' => 'Ultrasound', + 'ct' => 'CT Scan', + 'mri' => 'MRI', + 'ecg' => 'ECG', + 'custom' => 'Custom', + ], + + 'investigation_statuses' => [ + 'pending' => 'Pending', + 'sample_collected' => 'Sample collected', + 'in_progress' => 'In progress', + 'awaiting_review' => 'Awaiting review', + 'completed' => 'Completed', + 'delivered' => 'Delivered', + 'cancelled' => 'Cancelled', + ], + + 'prescription_statuses' => [ + 'draft' => 'Draft', + 'active' => 'Active', + 'dispensed' => 'Dispensed', + 'cancelled' => 'Cancelled', + ], + + 'medication_routes' => [ + 'oral' => 'Oral', + 'topical' => 'Topical', + 'injection' => 'Injection', + 'inhalation' => 'Inhalation', + 'sublingual' => 'Sublingual', + 'rectal' => 'Rectal', + 'other' => 'Other', + ], + + 'genders' => [ + 'male' => 'Male', + 'female' => 'Female', + 'other' => 'Other', + ], + + 'allergy_severities' => [ + 'mild' => 'Mild', + 'moderate' => 'Moderate', + 'severe' => 'Severe', + 'unknown' => 'Unknown', + ], + + 'document_types' => [ + 'id_card' => 'ID card', + 'insurance_card' => 'Insurance card', + 'lab_report' => 'Lab report', + 'referral' => 'Referral letter', + 'other' => 'Other', + ], + + 'patient_number' => [ + 'prefix' => env('CARE_PATIENT_NUMBER_PREFIX', 'LC'), + ], + + 'invoice_number' => [ + 'prefix' => env('CARE_INVOICE_PREFIX', 'INV'), + ], + + 'billing' => [ + 'consultation_fee_minor' => (int) env('CARE_CONSULTATION_FEE_MINOR', 5000), + 'currency' => env('CARE_CURRENCY', 'GHS'), + ], + + 'bill_statuses' => [ + 'draft' => 'Draft', + 'open' => 'Open', + 'partial' => 'Partially paid', + 'paid' => 'Paid', + 'void' => 'Void', + ], + + 'bill_line_types' => [ + 'consultation' => 'Consultation', + 'lab' => 'Laboratory', + 'imaging' => 'Imaging', + 'procedure' => 'Procedure', + 'pharmacy' => 'Pharmacy', + 'nursing' => 'Nursing', + 'misc' => 'Miscellaneous', + ], + + 'payment_methods' => [ + 'cash' => 'Cash', + 'momo' => 'Mobile Money', + 'card' => 'Card', + 'other' => 'Other', + ], + + 'report_types' => [ + 'patients' => 'Patients', + 'appointments' => 'Appointments', + 'laboratory' => 'Laboratory', + 'finance' => 'Finance', + 'clinical' => 'Clinical trends', + ], + + 'plans' => [ + 'free' => [ + 'label' => 'Free', + 'price_minor' => 0, + 'max_branches' => 1, + ], + 'pro' => [ + 'label' => 'Pro', + 'price_minor' => (int) env('CARE_PRO_PRICE_MINOR', 15000), + 'max_branches' => null, + ], + ], + +]; diff --git a/config/database.php b/config/database.php new file mode 100644 index 0000000..7b97fd2 --- /dev/null +++ b/config/database.php @@ -0,0 +1,204 @@ + env('DB_CONNECTION', 'sqlite'), + + /* + |-------------------------------------------------------------------------- + | Database Connections + |-------------------------------------------------------------------------- + | + | Below are all of the database connections defined for your application. + | An example configuration is provided for each database system which + | is supported by Laravel. You're free to add / remove connections. + | + */ + + 'connections' => [ + + 'sqlite' => [ + 'driver' => 'sqlite', + 'url' => env('DB_URL'), + 'database' => env('DB_DATABASE', database_path('database.sqlite')), + 'prefix' => '', + 'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true), + 'busy_timeout' => null, + 'journal_mode' => null, + 'synchronous' => null, + 'transaction_mode' => 'DEFERRED', + ], + + 'mysql' => [ + 'driver' => 'mysql', + 'url' => env('DB_URL'), + 'host' => env('DB_HOST', '127.0.0.1'), + 'port' => env('DB_PORT', '3306'), + 'database' => env('DB_DATABASE', 'laravel'), + 'username' => env('DB_USERNAME', 'root'), + 'password' => env('DB_PASSWORD', ''), + 'unix_socket' => env('DB_SOCKET', ''), + 'charset' => env('DB_CHARSET', 'utf8mb4'), + 'collation' => env('DB_COLLATION', 'utf8mb4_unicode_ci'), + 'prefix' => '', + 'prefix_indexes' => true, + 'strict' => true, + 'engine' => null, + 'options' => extension_loaded('pdo_mysql') ? array_filter([ + (PHP_VERSION_ID >= 80500 ? Mysql::ATTR_SSL_CA : PDO::MYSQL_ATTR_SSL_CA) => env('MYSQL_ATTR_SSL_CA'), + ]) : [], + ], + + // Read-only access to platform admin settings (Paystack keys, etc.). + 'platform' => [ + 'driver' => 'mysql', + 'host' => env('PLATFORM_DB_HOST', env('DB_HOST', '127.0.0.1')), + 'port' => env('PLATFORM_DB_PORT', env('DB_PORT', '3306')), + 'database' => env('PLATFORM_DB_DATABASE', 'ladilldb'), + 'username' => env('PLATFORM_DB_USERNAME', env('DB_USERNAME', 'root')), + 'password' => env('PLATFORM_DB_PASSWORD', env('DB_PASSWORD', '')), + 'unix_socket' => env('PLATFORM_DB_SOCKET', env('DB_SOCKET', '')), + 'charset' => env('DB_CHARSET', 'utf8mb4'), + 'collation' => env('DB_COLLATION', 'utf8mb4_unicode_ci'), + 'prefix' => '', + 'prefix_indexes' => true, + 'strict' => true, + 'engine' => null, + 'options' => extension_loaded('pdo_mysql') ? array_filter([ + (PHP_VERSION_ID >= 80500 ? Mysql::ATTR_SSL_CA : PDO::MYSQL_ATTR_SSL_CA) => env('MYSQL_ATTR_SSL_CA'), + ]) : [], + ], + + 'mariadb' => [ + 'driver' => 'mariadb', + 'url' => env('DB_URL'), + 'host' => env('DB_HOST', '127.0.0.1'), + 'port' => env('DB_PORT', '3306'), + 'database' => env('DB_DATABASE', 'laravel'), + 'username' => env('DB_USERNAME', 'root'), + 'password' => env('DB_PASSWORD', ''), + 'unix_socket' => env('DB_SOCKET', ''), + 'charset' => env('DB_CHARSET', 'utf8mb4'), + 'collation' => env('DB_COLLATION', 'utf8mb4_unicode_ci'), + 'prefix' => '', + 'prefix_indexes' => true, + 'strict' => true, + 'engine' => null, + 'options' => extension_loaded('pdo_mysql') ? array_filter([ + (PHP_VERSION_ID >= 80500 ? Mysql::ATTR_SSL_CA : PDO::MYSQL_ATTR_SSL_CA) => env('MYSQL_ATTR_SSL_CA'), + ]) : [], + ], + + 'pgsql' => [ + 'driver' => 'pgsql', + 'url' => env('DB_URL'), + 'host' => env('DB_HOST', '127.0.0.1'), + 'port' => env('DB_PORT', '5432'), + 'database' => env('DB_DATABASE', 'laravel'), + 'username' => env('DB_USERNAME', 'root'), + 'password' => env('DB_PASSWORD', ''), + 'charset' => env('DB_CHARSET', 'utf8'), + 'prefix' => '', + 'prefix_indexes' => true, + 'search_path' => 'public', + 'sslmode' => env('DB_SSLMODE', 'prefer'), + ], + + 'sqlsrv' => [ + 'driver' => 'sqlsrv', + 'url' => env('DB_URL'), + 'host' => env('DB_HOST', 'localhost'), + 'port' => env('DB_PORT', '1433'), + 'database' => env('DB_DATABASE', 'laravel'), + 'username' => env('DB_USERNAME', 'root'), + 'password' => env('DB_PASSWORD', ''), + 'charset' => env('DB_CHARSET', 'utf8'), + 'prefix' => '', + 'prefix_indexes' => true, + // 'encrypt' => env('DB_ENCRYPT', 'yes'), + // 'trust_server_certificate' => env('DB_TRUST_SERVER_CERTIFICATE', 'false'), + ], + + ], + + /* + |-------------------------------------------------------------------------- + | Migration Repository Table + |-------------------------------------------------------------------------- + | + | This table keeps track of all the migrations that have already run for + | your application. Using this information, we can determine which of + | the migrations on disk haven't actually been run on the database. + | + */ + + 'migrations' => [ + 'table' => 'migrations', + 'update_date_on_publish' => true, + ], + + /* + |-------------------------------------------------------------------------- + | Redis Databases + |-------------------------------------------------------------------------- + | + | Redis is an open source, fast, and advanced key-value store that also + | provides a richer body of commands than a typical key-value system + | such as Memcached. You may define your connection settings here. + | + */ + + 'redis' => [ + + 'client' => env('REDIS_CLIENT', 'phpredis'), + + 'options' => [ + 'cluster' => env('REDIS_CLUSTER', 'redis'), + 'prefix' => env('REDIS_PREFIX', Str::slug((string) env('APP_NAME', 'laravel')).'-database-'), + 'persistent' => env('REDIS_PERSISTENT', false), + ], + + 'default' => [ + 'url' => env('REDIS_URL'), + 'host' => env('REDIS_HOST', '127.0.0.1'), + 'username' => env('REDIS_USERNAME'), + 'password' => env('REDIS_PASSWORD'), + 'port' => env('REDIS_PORT', '6379'), + 'database' => env('REDIS_DB', '0'), + 'max_retries' => env('REDIS_MAX_RETRIES', 3), + 'backoff_algorithm' => env('REDIS_BACKOFF_ALGORITHM', 'decorrelated_jitter'), + 'backoff_base' => env('REDIS_BACKOFF_BASE', 100), + 'backoff_cap' => env('REDIS_BACKOFF_CAP', 1000), + ], + + 'cache' => [ + 'url' => env('REDIS_URL'), + 'host' => env('REDIS_HOST', '127.0.0.1'), + 'username' => env('REDIS_USERNAME'), + 'password' => env('REDIS_PASSWORD'), + 'port' => env('REDIS_PORT', '6379'), + 'database' => env('REDIS_CACHE_DB', '1'), + 'max_retries' => env('REDIS_MAX_RETRIES', 3), + 'backoff_algorithm' => env('REDIS_BACKOFF_ALGORITHM', 'decorrelated_jitter'), + 'backoff_base' => env('REDIS_BACKOFF_BASE', 100), + 'backoff_cap' => env('REDIS_BACKOFF_CAP', 1000), + ], + + ], + +]; diff --git a/config/filesystems.php b/config/filesystems.php new file mode 100644 index 0000000..4ebaa0b --- /dev/null +++ b/config/filesystems.php @@ -0,0 +1,87 @@ + env('FILESYSTEM_DISK', 'local'), + + /* + |-------------------------------------------------------------------------- + | Filesystem Disks + |-------------------------------------------------------------------------- + | + | Below you may configure as many filesystem disks as necessary, and you + | may even configure multiple disks for the same driver. Examples for + | most supported storage drivers are configured here for reference. + | + | Supported drivers: "local", "ftp", "sftp", "s3" + | + */ + + 'disks' => [ + + 'local' => [ + 'driver' => 'local', + 'root' => storage_path('app/private'), + 'serve' => true, + 'throw' => false, + 'report' => false, + ], + + 'public' => [ + 'driver' => 'local', + 'root' => storage_path('app/public'), + 'url' => rtrim(env('APP_URL', 'http://localhost'), '/').'/storage', + 'visibility' => 'public', + 'throw' => false, + 'report' => false, + ], + + 's3' => [ + 'driver' => 's3', + 'key' => env('AWS_ACCESS_KEY_ID'), + 'secret' => env('AWS_SECRET_ACCESS_KEY'), + 'region' => env('AWS_DEFAULT_REGION'), + 'bucket' => env('AWS_BUCKET'), + 'url' => env('AWS_URL'), + 'endpoint' => env('AWS_ENDPOINT'), + 'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false), + 'throw' => false, + 'report' => false, + ], + + 'qr' => [ + 'driver' => 'local', + 'root' => storage_path('app/private/qr'), + 'throw' => false, + 'report' => false, + ], + + ], + + /* + |-------------------------------------------------------------------------- + | Symbolic Links + |-------------------------------------------------------------------------- + | + | Here you may configure the symbolic links that will be created when the + | `storage:link` Artisan command is executed. The array keys should be + | the locations of the links and the values should be their targets. + | + */ + + 'links' => [ + public_path('storage') => storage_path('app/public'), + ], + +]; diff --git a/config/identity.php b/config/identity.php new file mode 100644 index 0000000..ddf0236 --- /dev/null +++ b/config/identity.php @@ -0,0 +1,7 @@ + env('IDENTITY_API_URL', 'https://ladill.com/api'), + 'api_key' => env('IDENTITY_API_KEY_CARE'), +]; diff --git a/config/ladill.php b/config/ladill.php new file mode 100644 index 0000000..7e9e2bf --- /dev/null +++ b/config/ladill.php @@ -0,0 +1,6 @@ + 'care', + 'marketing_url' => env('LADILL_MARKETING_URL', 'https://ladill.com/products/care'), +]; diff --git a/config/ladill_launcher.php b/config/ladill_launcher.php new file mode 100644 index 0000000..f100662 --- /dev/null +++ b/config/ladill_launcher.php @@ -0,0 +1,42 @@ +. +*/ + +$root = config('app.platform_domain', 'ladill.com'); + +return [ + 'apps' => [ + ['name' => 'Merchant', 'url' => 'https://merchant.'.$root.'/sso/connect?redirect='.urlencode('https://merchant.'.$root.'/dashboard'), 'icon' => 'merchant.svg'], + ['name' => 'POS', 'url' => 'https://pos.'.$root.'/sso/connect?redirect='.urlencode('https://pos.'.$root.'/dashboard'), 'icon' => 'pos.svg'], + ['name' => 'Mini', 'url' => 'https://mini.'.$root.'/sso/connect?redirect='.urlencode('https://mini.'.$root.'/dashboard'), 'icon' => 'mini.svg'], + ['name' => 'Give', 'url' => 'https://give.'.$root.'/sso/connect?redirect='.urlencode('https://give.'.$root.'/dashboard'), 'icon' => 'give.svg'], + ['name' => 'Transfer', 'url' => 'https://transfer.'.$root.'/sso/connect?redirect='.urlencode('https://transfer.'.$root.'/dashboard'), 'icon' => 'transfer.svg'], + ['name' => 'Accounting', 'url' => 'https://accounting.'.$root.'/sso/connect?redirect='.urlencode('https://accounting.'.$root.'/dashboard'), 'icon' => 'accounting.svg'], + ['name' => 'Invoice', 'url' => 'https://invoice.'.$root.'/sso/connect?redirect='.urlencode('https://invoice.'.$root.'/dashboard'), 'icon' => 'invoice.svg'], + ['name' => 'CRM', 'url' => 'https://crm.'.$root.'/sso/connect?redirect='.urlencode('https://crm.'.$root.'/dashboard'), 'icon' => 'crm.svg'], + ['name' => 'Events', 'url' => 'https://events.'.$root.'/sso/connect?redirect='.urlencode('https://events.'.$root.'/dashboard'), 'icon' => 'events.svg'], + ['name' => 'QR Plus', 'url' => 'https://qrplus.'.$root.'/sso/connect?redirect='.urlencode('https://qrplus.'.$root.'/dashboard'), 'icon' => 'qrplus.svg'], + ['name' => 'Link', 'url' => 'https://link.'.$root.'/sso/connect?redirect='.urlencode('https://link.'.$root.'/dashboard'), 'icon' => 'link.svg'], + ['name' => 'Frontdesk', 'url' => 'https://frontdesk.'.$root.'/sso/connect?redirect='.urlencode('https://frontdesk.'.$root.'/dashboard'), 'icon' => 'frontdesk.svg'], + ['name' => 'Care', 'url' => 'https://care.'.$root.'/sso/connect?redirect='.urlencode('https://care.'.$root.'/dashboard'), 'icon' => 'care.svg'], + ['name' => 'SMS', 'url' => 'https://sms.'.$root, 'icon' => 'sms.svg'], + ['name' => 'Bird', 'url' => 'https://bird.'.$root, 'icon' => 'bird.svg'], + ['name' => 'Mail', 'url' => 'https://mail.'.$root, 'icon' => 'mail.svg'], + ['name' => 'Email', 'url' => 'https://email.'.$root, 'icon' => 'email.svg'], + ['name' => 'Domains', 'url' => 'https://domains.'.$root, 'icon' => 'domains.svg'], + ['name' => 'Servers', 'url' => 'https://servers.'.$root, 'icon' => 'servers.svg'], + ['name' => 'Hosting', 'url' => 'https://hosting.'.$root, 'icon' => 'hosting.svg'], + ], +]; diff --git a/config/logging.php b/config/logging.php new file mode 100644 index 0000000..b09cb25 --- /dev/null +++ b/config/logging.php @@ -0,0 +1,132 @@ + env('LOG_CHANNEL', 'stack'), + + /* + |-------------------------------------------------------------------------- + | Deprecations Log Channel + |-------------------------------------------------------------------------- + | + | This option controls the log channel that should be used to log warnings + | regarding deprecated PHP and library features. This allows you to get + | your application ready for upcoming major versions of dependencies. + | + */ + + 'deprecations' => [ + 'channel' => env('LOG_DEPRECATIONS_CHANNEL', 'null'), + 'trace' => env('LOG_DEPRECATIONS_TRACE', false), + ], + + /* + |-------------------------------------------------------------------------- + | Log Channels + |-------------------------------------------------------------------------- + | + | Here you may configure the log channels for your application. Laravel + | utilizes the Monolog PHP logging library, which includes a variety + | of powerful log handlers and formatters that you're free to use. + | + | Available drivers: "single", "daily", "slack", "syslog", + | "errorlog", "monolog", "custom", "stack" + | + */ + + 'channels' => [ + + 'stack' => [ + 'driver' => 'stack', + 'channels' => explode(',', (string) env('LOG_STACK', 'single')), + 'ignore_exceptions' => false, + ], + + 'single' => [ + 'driver' => 'single', + 'path' => storage_path('logs/laravel.log'), + 'level' => env('LOG_LEVEL', 'debug'), + 'replace_placeholders' => true, + ], + + 'daily' => [ + 'driver' => 'daily', + 'path' => storage_path('logs/laravel.log'), + 'level' => env('LOG_LEVEL', 'debug'), + 'days' => env('LOG_DAILY_DAYS', 14), + 'replace_placeholders' => true, + ], + + 'slack' => [ + 'driver' => 'slack', + 'url' => env('LOG_SLACK_WEBHOOK_URL'), + 'username' => env('LOG_SLACK_USERNAME', env('APP_NAME', 'Laravel')), + 'emoji' => env('LOG_SLACK_EMOJI', ':boom:'), + 'level' => env('LOG_LEVEL', 'critical'), + 'replace_placeholders' => true, + ], + + 'papertrail' => [ + 'driver' => 'monolog', + 'level' => env('LOG_LEVEL', 'debug'), + 'handler' => env('LOG_PAPERTRAIL_HANDLER', SyslogUdpHandler::class), + 'handler_with' => [ + 'host' => env('PAPERTRAIL_URL'), + 'port' => env('PAPERTRAIL_PORT'), + 'connectionString' => 'tls://'.env('PAPERTRAIL_URL').':'.env('PAPERTRAIL_PORT'), + ], + 'processors' => [PsrLogMessageProcessor::class], + ], + + 'stderr' => [ + 'driver' => 'monolog', + 'level' => env('LOG_LEVEL', 'debug'), + 'handler' => StreamHandler::class, + 'handler_with' => [ + 'stream' => 'php://stderr', + ], + 'formatter' => env('LOG_STDERR_FORMATTER'), + 'processors' => [PsrLogMessageProcessor::class], + ], + + 'syslog' => [ + 'driver' => 'syslog', + 'level' => env('LOG_LEVEL', 'debug'), + 'facility' => env('LOG_SYSLOG_FACILITY', LOG_USER), + 'replace_placeholders' => true, + ], + + 'errorlog' => [ + 'driver' => 'errorlog', + 'level' => env('LOG_LEVEL', 'debug'), + 'replace_placeholders' => true, + ], + + 'null' => [ + 'driver' => 'monolog', + 'handler' => NullHandler::class, + ], + + 'emergency' => [ + 'path' => storage_path('logs/laravel.log'), + ], + + ], + +]; diff --git a/config/mail.php b/config/mail.php new file mode 100644 index 0000000..4df3820 --- /dev/null +++ b/config/mail.php @@ -0,0 +1,132 @@ + $mailScheme, + $mailScheme !== '' => null, + in_array($mailEncryption, ['ssl', 'smtps'], true) => 'smtps', + in_array($mailEncryption, ['tls', 'starttls', 'smtp'], true) => 'smtp', + default => null, +}; + +return [ + + /* + |-------------------------------------------------------------------------- + | Default Mailer + |-------------------------------------------------------------------------- + | + | This option controls the default mailer that is used to send all email + | messages unless another mailer is explicitly specified when sending + | the message. All additional mailers can be configured within the + | "mailers" array. Examples of each type of mailer are provided. + | + */ + + 'default' => env('MAIL_MAILER', 'log'), + + /* + |-------------------------------------------------------------------------- + | Mailer Configurations + |-------------------------------------------------------------------------- + | + | Here you may configure all of the mailers used by your application plus + | their respective settings. Several examples have been configured for + | you and you are free to add your own as your application requires. + | + | Laravel supports a variety of mail "transport" drivers that can be used + | when delivering an email. You may specify which one you're using for + | your mailers below. You may also add additional mailers if needed. + | + | Supported: "smtp", "sendmail", "mailgun", "ses", "ses-v2", + | "postmark", "resend", "log", "array", + | "failover", "roundrobin" + | + */ + + 'mailers' => [ + + 'smtp' => [ + 'transport' => 'smtp', + 'scheme' => $smtpScheme, + 'url' => env('MAIL_URL'), + 'host' => env('MAIL_HOST', '127.0.0.1'), + 'port' => env('MAIL_PORT', 2525), + 'username' => env('MAIL_USERNAME'), + 'password' => env('MAIL_PASSWORD'), + 'timeout' => null, + 'local_domain' => env('MAIL_EHLO_DOMAIN', parse_url((string) env('APP_URL', 'http://localhost'), PHP_URL_HOST)), + ], + + 'ses' => [ + 'transport' => 'ses', + ], + + 'postmark' => [ + 'transport' => 'postmark', + // 'message_stream_id' => env('POSTMARK_MESSAGE_STREAM_ID'), + // 'client' => [ + // 'timeout' => 5, + // ], + ], + + 'resend' => [ + 'transport' => 'resend', + ], + + 'sendmail' => [ + 'transport' => 'sendmail', + 'path' => env('MAIL_SENDMAIL_PATH', '/usr/sbin/sendmail -bs -i'), + ], + + 'log' => [ + 'transport' => 'log', + 'channel' => env('MAIL_LOG_CHANNEL'), + ], + + 'array' => [ + 'transport' => 'array', + ], + + 'failover' => [ + 'transport' => 'failover', + 'mailers' => [ + 'smtp', + 'log', + ], + 'retry_after' => 60, + ], + + 'roundrobin' => [ + 'transport' => 'roundrobin', + 'mailers' => [ + 'ses', + 'postmark', + ], + 'retry_after' => 60, + ], + + ], + + /* + |-------------------------------------------------------------------------- + | Global "From" Address + |-------------------------------------------------------------------------- + | + | You may wish for all emails sent by your application to be sent from + | the same address. Here you may specify a name and address that is + | used globally for all emails that are sent by your application. + | + */ + + 'from' => [ + 'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'), + 'name' => env('MAIL_FROM_NAME', env('APP_NAME', 'Laravel')), + ], + +]; diff --git a/config/mobile-topbar.php b/config/mobile-topbar.php new file mode 100644 index 0000000..653a682 --- /dev/null +++ b/config/mobile-topbar.php @@ -0,0 +1,5 @@ + 'Care', +]; diff --git a/config/queue.php b/config/queue.php new file mode 100644 index 0000000..79c2c0a --- /dev/null +++ b/config/queue.php @@ -0,0 +1,129 @@ + env('QUEUE_CONNECTION', 'database'), + + /* + |-------------------------------------------------------------------------- + | Queue Connections + |-------------------------------------------------------------------------- + | + | Here you may configure the connection options for every queue backend + | used by your application. An example configuration is provided for + | each backend supported by Laravel. You're also free to add more. + | + | Drivers: "sync", "database", "beanstalkd", "sqs", "redis", + | "deferred", "background", "failover", "null" + | + */ + + 'connections' => [ + + 'sync' => [ + 'driver' => 'sync', + ], + + 'database' => [ + 'driver' => 'database', + 'connection' => env('DB_QUEUE_CONNECTION'), + 'table' => env('DB_QUEUE_TABLE', 'jobs'), + 'queue' => env('DB_QUEUE', 'default'), + 'retry_after' => (int) env('DB_QUEUE_RETRY_AFTER', 90), + 'after_commit' => false, + ], + + 'beanstalkd' => [ + 'driver' => 'beanstalkd', + 'host' => env('BEANSTALKD_QUEUE_HOST', 'localhost'), + 'queue' => env('BEANSTALKD_QUEUE', 'default'), + 'retry_after' => (int) env('BEANSTALKD_QUEUE_RETRY_AFTER', 90), + 'block_for' => 0, + 'after_commit' => false, + ], + + 'sqs' => [ + 'driver' => 'sqs', + 'key' => env('AWS_ACCESS_KEY_ID'), + 'secret' => env('AWS_SECRET_ACCESS_KEY'), + 'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'), + 'queue' => env('SQS_QUEUE', 'default'), + 'suffix' => env('SQS_SUFFIX'), + 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), + 'after_commit' => false, + ], + + 'redis' => [ + 'driver' => 'redis', + 'connection' => env('REDIS_QUEUE_CONNECTION', 'default'), + 'queue' => env('REDIS_QUEUE', 'default'), + 'retry_after' => (int) env('REDIS_QUEUE_RETRY_AFTER', 90), + 'block_for' => null, + 'after_commit' => false, + ], + + 'deferred' => [ + 'driver' => 'deferred', + ], + + 'background' => [ + 'driver' => 'background', + ], + + 'failover' => [ + 'driver' => 'failover', + 'connections' => [ + 'database', + 'deferred', + ], + ], + + ], + + /* + |-------------------------------------------------------------------------- + | Job Batching + |-------------------------------------------------------------------------- + | + | The following options configure the database and table that store job + | batching information. These options can be updated to any database + | connection and table which has been defined by your application. + | + */ + + 'batching' => [ + 'database' => env('DB_CONNECTION', 'sqlite'), + 'table' => 'job_batches', + ], + + /* + |-------------------------------------------------------------------------- + | Failed Queue Jobs + |-------------------------------------------------------------------------- + | + | These options configure the behavior of failed queue job logging so you + | can control how and where failed jobs are stored. Laravel ships with + | support for storing failed jobs in a simple file or in a database. + | + | Supported drivers: "database-uuids", "dynamodb", "file", "null" + | + */ + + 'failed' => [ + 'driver' => env('QUEUE_FAILED_DRIVER', 'database-uuids'), + 'database' => env('DB_CONNECTION', 'sqlite'), + 'table' => 'failed_jobs', + ], + +]; diff --git a/config/service_events.php b/config/service_events.php new file mode 100644 index 0000000..f93bf20 --- /dev/null +++ b/config/service_events.php @@ -0,0 +1,9 @@ + env('SERVICE_EVENTS_INBOUND_SECRET', ''), +]; diff --git a/config/services.php b/config/services.php new file mode 100644 index 0000000..5ad6df2 --- /dev/null +++ b/config/services.php @@ -0,0 +1,44 @@ + [ + 'issuer' => 'https://'.config('app.auth_domain'), + 'client_id' => env('LADILL_SSO_CLIENT_ID'), + 'client_secret' => env('LADILL_SSO_CLIENT_SECRET'), + 'redirect' => rtrim((string) env('APP_URL', 'https://care.ladill.com'), '/').'/sso/callback', + ], + + // Central Ladill identity API (auth.ladill.com /api/identity/auth/*), + // gated by the shared first-party service key. + 'ladill_identity' => [ + 'url' => 'https://'.config('app.auth_domain'), + 'key' => env('IDENTITY_API_KEY_CARE'), + ], + + // Outbound SMS to contacts uses Arkesel (the platform provider) — see + // config/arkesel.php and App\Services\Comms\SmsService. + + 'slack' => [ + 'notifications' => [ + 'bot_user_oauth_token' => env('SLACK_BOT_USER_OAUTH_TOKEN'), + 'channel' => env('SLACK_BOT_USER_DEFAULT_CHANNEL'), + ], + ], + +]; diff --git a/config/session.php b/config/session.php new file mode 100644 index 0000000..570bbab --- /dev/null +++ b/config/session.php @@ -0,0 +1,217 @@ + env('SESSION_DRIVER', 'database'), + + /* + |-------------------------------------------------------------------------- + | Session Lifetime + |-------------------------------------------------------------------------- + | + | Here you may specify the number of minutes that you wish the session + | to be allowed to remain idle before it expires. If you want them + | to expire immediately when the browser is closed then you may + | indicate that via the expire_on_close configuration option. + | + */ + + 'lifetime' => (int) env('SESSION_LIFETIME', 1440), + + 'expire_on_close' => env('SESSION_EXPIRE_ON_CLOSE', false), + + /* + |-------------------------------------------------------------------------- + | Session Encryption + |-------------------------------------------------------------------------- + | + | This option allows you to easily specify that all of your session data + | should be encrypted before it's stored. All encryption is performed + | automatically by Laravel and you may use the session like normal. + | + */ + + 'encrypt' => env('SESSION_ENCRYPT', false), + + /* + |-------------------------------------------------------------------------- + | Session File Location + |-------------------------------------------------------------------------- + | + | When utilizing the "file" session driver, the session files are placed + | on disk. The default storage location is defined here; however, you + | are free to provide another location where they should be stored. + | + */ + + 'files' => storage_path('framework/sessions'), + + /* + |-------------------------------------------------------------------------- + | Session Database Connection + |-------------------------------------------------------------------------- + | + | When using the "database" or "redis" session drivers, you may specify a + | connection that should be used to manage these sessions. This should + | correspond to a connection in your database configuration options. + | + */ + + 'connection' => env('SESSION_CONNECTION'), + + /* + |-------------------------------------------------------------------------- + | Session Database Table + |-------------------------------------------------------------------------- + | + | When using the "database" session driver, you may specify the table to + | be used to store sessions. Of course, a sensible default is defined + | for you; however, you're welcome to change this to another table. + | + */ + + 'table' => env('SESSION_TABLE', 'sessions'), + + /* + |-------------------------------------------------------------------------- + | Session Cache Store + |-------------------------------------------------------------------------- + | + | When using one of the framework's cache driven session backends, you may + | define the cache store which should be used to store the session data + | between requests. This must match one of your defined cache stores. + | + | Affects: "dynamodb", "memcached", "redis" + | + */ + + 'store' => env('SESSION_STORE'), + + /* + |-------------------------------------------------------------------------- + | Session Sweeping Lottery + |-------------------------------------------------------------------------- + | + | Some session drivers must manually sweep their storage location to get + | rid of old sessions from storage. Here are the chances that it will + | happen on a given request. By default, the odds are 2 out of 100. + | + */ + + 'lottery' => [2, 100], + + /* + |-------------------------------------------------------------------------- + | Session Cookie Name + |-------------------------------------------------------------------------- + | + | Here you may change the name of the session cookie that is created by + | the framework. Typically, you should not need to change this value + | since doing so does not grant a meaningful security improvement. + | + */ + + 'cookie' => env( + 'SESSION_COOKIE', + Str::slug((string) env('APP_NAME', 'laravel')).'-session' + ), + + /* + |-------------------------------------------------------------------------- + | Session Cookie Path + |-------------------------------------------------------------------------- + | + | The session cookie path determines the path for which the cookie will + | be regarded as available. Typically, this will be the root path of + | your application, but you're free to change this when necessary. + | + */ + + 'path' => env('SESSION_PATH', '/'), + + /* + |-------------------------------------------------------------------------- + | Session Cookie Domain + |-------------------------------------------------------------------------- + | + | This value determines the domain and subdomains the session cookie is + | available to. By default, the cookie will be available to the root + | domain without subdomains. Typically, this shouldn't be changed. + | + */ + + 'domain' => env('SESSION_DOMAIN'), + + /* + |-------------------------------------------------------------------------- + | HTTPS Only Cookies + |-------------------------------------------------------------------------- + | + | By setting this option to true, session cookies will only be sent back + | to the server if the browser has a HTTPS connection. This will keep + | the cookie from being sent to you when it can't be done securely. + | + */ + + 'secure' => env('SESSION_SECURE_COOKIE'), + + /* + |-------------------------------------------------------------------------- + | HTTP Access Only + |-------------------------------------------------------------------------- + | + | Setting this value to true will prevent JavaScript from accessing the + | value of the cookie and the cookie will only be accessible through + | the HTTP protocol. It's unlikely you should disable this option. + | + */ + + 'http_only' => env('SESSION_HTTP_ONLY', true), + + /* + |-------------------------------------------------------------------------- + | Same-Site Cookies + |-------------------------------------------------------------------------- + | + | This option determines how your cookies behave when cross-site requests + | take place, and can be used to mitigate CSRF attacks. By default, we + | will set this value to "lax" to permit secure cross-site requests. + | + | See: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie#samesitesamesite-value + | + | Supported: "lax", "strict", "none", null + | + */ + + 'same_site' => env('SESSION_SAME_SITE', 'lax'), + + /* + |-------------------------------------------------------------------------- + | Partitioned Cookies + |-------------------------------------------------------------------------- + | + | Setting this value to true will tie the cookie to the top-level site for + | a cross-site context. Partitioned cookies are accepted by the browser + | when flagged "secure" and the Same-Site attribute is set to "none". + | + */ + + 'partitioned' => env('SESSION_PARTITIONED_COOKIE', false), + +]; diff --git a/config/signed_out.php b/config/signed_out.php new file mode 100644 index 0000000..44a2cbe --- /dev/null +++ b/config/signed_out.php @@ -0,0 +1,7 @@ + 'Ladill Care', + 'logo' => 'images/logo/ladillcare-logo.svg', + 'description' => 'Your Ladill Care session has ended. Sign in again to manage your healthcare facility.', +]; diff --git a/database/.gitignore b/database/.gitignore new file mode 100644 index 0000000..9b19b93 --- /dev/null +++ b/database/.gitignore @@ -0,0 +1 @@ +*.sqlite* diff --git a/database/migrations/0001_01_01_000000_create_users_table.php b/database/migrations/0001_01_01_000000_create_users_table.php new file mode 100644 index 0000000..a138076 --- /dev/null +++ b/database/migrations/0001_01_01_000000_create_users_table.php @@ -0,0 +1,52 @@ +id(); + $table->uuid('public_id')->unique(); + $table->string('name')->nullable(); + $table->string('email')->unique(); + $table->string('avatar_url')->nullable(); + $table->timestamp('email_verified_at')->nullable(); + $table->string('password')->nullable(); + $table->rememberToken(); + $table->timestamps(); + }); + + Schema::create('password_reset_tokens', function (Blueprint $table) { + $table->string('email')->primary(); + $table->string('token'); + $table->timestamp('created_at')->nullable(); + }); + + Schema::create('sessions', function (Blueprint $table) { + $table->string('id')->primary(); + $table->foreignId('user_id')->nullable()->index(); + $table->string('ip_address', 45)->nullable(); + $table->text('user_agent')->nullable(); + $table->longText('payload'); + $table->integer('last_activity')->index(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('users'); + Schema::dropIfExists('password_reset_tokens'); + Schema::dropIfExists('sessions'); + } +}; diff --git a/database/migrations/0001_01_01_000001_create_cache_table.php b/database/migrations/0001_01_01_000001_create_cache_table.php new file mode 100644 index 0000000..ed758bd --- /dev/null +++ b/database/migrations/0001_01_01_000001_create_cache_table.php @@ -0,0 +1,35 @@ +string('key')->primary(); + $table->mediumText('value'); + $table->integer('expiration')->index(); + }); + + Schema::create('cache_locks', function (Blueprint $table) { + $table->string('key')->primary(); + $table->string('owner'); + $table->integer('expiration')->index(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('cache'); + Schema::dropIfExists('cache_locks'); + } +}; diff --git a/database/migrations/0001_01_01_000002_create_jobs_table.php b/database/migrations/0001_01_01_000002_create_jobs_table.php new file mode 100644 index 0000000..425e705 --- /dev/null +++ b/database/migrations/0001_01_01_000002_create_jobs_table.php @@ -0,0 +1,57 @@ +id(); + $table->string('queue')->index(); + $table->longText('payload'); + $table->unsignedTinyInteger('attempts'); + $table->unsignedInteger('reserved_at')->nullable(); + $table->unsignedInteger('available_at'); + $table->unsignedInteger('created_at'); + }); + + Schema::create('job_batches', function (Blueprint $table) { + $table->string('id')->primary(); + $table->string('name'); + $table->integer('total_jobs'); + $table->integer('pending_jobs'); + $table->integer('failed_jobs'); + $table->longText('failed_job_ids'); + $table->mediumText('options')->nullable(); + $table->integer('cancelled_at')->nullable(); + $table->integer('created_at'); + $table->integer('finished_at')->nullable(); + }); + + Schema::create('failed_jobs', function (Blueprint $table) { + $table->id(); + $table->string('uuid')->unique(); + $table->text('connection'); + $table->text('queue'); + $table->longText('payload'); + $table->longText('exception'); + $table->timestamp('failed_at')->useCurrent(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('jobs'); + Schema::dropIfExists('job_batches'); + Schema::dropIfExists('failed_jobs'); + } +}; diff --git a/database/migrations/2026_06_30_100000_create_care_core_tables.php b/database/migrations/2026_06_30_100000_create_care_core_tables.php new file mode 100644 index 0000000..a92c807 --- /dev/null +++ b/database/migrations/2026_06_30_100000_create_care_core_tables.php @@ -0,0 +1,87 @@ +id(); + $table->string('owner_ref')->index(); + $table->string('name'); + $table->string('slug')->index(); + $table->string('logo_path')->nullable(); + $table->string('timezone')->default('UTC'); + $table->json('settings')->nullable(); + $table->timestamps(); + $table->softDeletes(); + $table->unique(['owner_ref', 'slug']); + }); + + Schema::create('care_branches', function (Blueprint $table) { + $table->id(); + $table->string('owner_ref')->index(); + $table->foreignId('organization_id')->constrained('care_organizations')->cascadeOnDelete(); + $table->string('name'); + $table->string('code')->nullable(); + $table->string('address')->nullable(); + $table->string('phone')->nullable(); + $table->boolean('is_active')->default(true); + $table->timestamps(); + $table->softDeletes(); + }); + + Schema::create('care_departments', function (Blueprint $table) { + $table->id(); + $table->string('owner_ref')->index(); + $table->foreignId('branch_id')->constrained('care_branches')->cascadeOnDelete(); + $table->string('name'); + $table->string('type')->default('general'); // general, outpatient, laboratory, pharmacy, radiology, etc. + $table->boolean('is_active')->default(true); + $table->timestamps(); + $table->softDeletes(); + }); + + Schema::create('care_members', function (Blueprint $table) { + $table->id(); + $table->string('owner_ref')->index(); + $table->foreignId('organization_id')->constrained('care_organizations')->cascadeOnDelete(); + $table->string('user_ref')->index(); + $table->string('role'); + $table->foreignId('branch_id')->nullable()->constrained('care_branches')->nullOnDelete(); + $table->timestamps(); + $table->unique(['organization_id', 'user_ref']); + }); + + Schema::create('care_audit_logs', function (Blueprint $table) { + $table->id(); + $table->string('owner_ref')->index(); + $table->foreignId('organization_id')->nullable()->constrained('care_organizations')->nullOnDelete(); + $table->string('actor_ref')->nullable(); + $table->string('action'); + $table->string('subject_type')->nullable(); + $table->unsignedBigInteger('subject_id')->nullable(); + $table->json('metadata')->nullable(); + $table->string('ip_address')->nullable(); + $table->timestamp('created_at')->useCurrent(); + $table->index(['owner_ref', 'created_at']); + }); + } + + public function down(): void + { + Schema::dropIfExists('care_audit_logs'); + Schema::dropIfExists('care_members'); + Schema::dropIfExists('care_departments'); + Schema::dropIfExists('care_branches'); + Schema::dropIfExists('care_organizations'); + } +}; diff --git a/database/migrations/2026_07_01_100000_create_care_patient_tables.php b/database/migrations/2026_07_01_100000_create_care_patient_tables.php new file mode 100644 index 0000000..680bae5 --- /dev/null +++ b/database/migrations/2026_07_01_100000_create_care_patient_tables.php @@ -0,0 +1,113 @@ +id(); + $table->uuid('uuid')->unique(); + $table->string('owner_ref')->index(); + $table->foreignId('organization_id')->constrained('care_organizations')->cascadeOnDelete(); + $table->foreignId('branch_id')->nullable()->constrained('care_branches')->nullOnDelete(); + $table->string('patient_number')->index(); + $table->string('first_name'); + $table->string('last_name'); + $table->string('other_names')->nullable(); + $table->string('gender')->nullable(); + $table->date('date_of_birth')->nullable(); + $table->string('phone')->nullable()->index(); + $table->string('email')->nullable(); + $table->string('national_id')->nullable()->index(); + $table->string('address')->nullable(); + $table->string('city')->nullable(); + $table->string('region')->nullable(); + $table->text('notes')->nullable(); + $table->timestamps(); + $table->softDeletes(); + $table->unique(['organization_id', 'patient_number']); + $table->index(['owner_ref', 'last_name', 'first_name']); + }); + + Schema::create('care_patient_allergies', function (Blueprint $table) { + $table->id(); + $table->string('owner_ref')->index(); + $table->foreignId('patient_id')->constrained('care_patients')->cascadeOnDelete(); + $table->string('allergen'); + $table->string('severity')->default('unknown'); + $table->text('notes')->nullable(); + $table->timestamps(); + }); + + Schema::create('care_patient_conditions', function (Blueprint $table) { + $table->id(); + $table->string('owner_ref')->index(); + $table->foreignId('patient_id')->constrained('care_patients')->cascadeOnDelete(); + $table->string('condition'); + $table->date('onset_date')->nullable(); + $table->boolean('is_chronic')->default(false); + $table->text('notes')->nullable(); + $table->timestamps(); + }); + + Schema::create('care_patient_family_history', function (Blueprint $table) { + $table->id(); + $table->string('owner_ref')->index(); + $table->foreignId('patient_id')->constrained('care_patients')->cascadeOnDelete(); + $table->string('relation'); + $table->string('condition'); + $table->text('notes')->nullable(); + $table->timestamps(); + }); + + Schema::create('care_emergency_contacts', function (Blueprint $table) { + $table->id(); + $table->string('owner_ref')->index(); + $table->foreignId('patient_id')->constrained('care_patients')->cascadeOnDelete(); + $table->string('name'); + $table->string('phone'); + $table->string('relationship')->nullable(); + $table->boolean('is_primary')->default(false); + $table->timestamps(); + }); + + Schema::create('care_insurance_policies', function (Blueprint $table) { + $table->id(); + $table->string('owner_ref')->index(); + $table->foreignId('patient_id')->constrained('care_patients')->cascadeOnDelete(); + $table->string('provider_name'); + $table->string('policy_number')->nullable(); + $table->string('coverage_type')->nullable(); + $table->date('expiry_date')->nullable(); + $table->text('notes')->nullable(); + $table->timestamps(); + }); + + Schema::create('care_patient_attachments', function (Blueprint $table) { + $table->id(); + $table->string('owner_ref')->index(); + $table->foreignId('patient_id')->constrained('care_patients')->cascadeOnDelete(); + $table->string('file_path'); + $table->string('original_name'); + $table->string('mime_type')->nullable(); + $table->string('document_type')->default('other'); + $table->string('uploaded_by')->nullable(); + $table->timestamps(); + }); + } + + public function down(): void + { + Schema::dropIfExists('care_patient_attachments'); + Schema::dropIfExists('care_insurance_policies'); + Schema::dropIfExists('care_emergency_contacts'); + Schema::dropIfExists('care_patient_family_history'); + Schema::dropIfExists('care_patient_conditions'); + Schema::dropIfExists('care_patient_allergies'); + Schema::dropIfExists('care_patients'); + } +}; diff --git a/database/migrations/2026_07_02_100000_create_care_clinical_tables.php b/database/migrations/2026_07_02_100000_create_care_clinical_tables.php new file mode 100644 index 0000000..aa2f950 --- /dev/null +++ b/database/migrations/2026_07_02_100000_create_care_clinical_tables.php @@ -0,0 +1,148 @@ +id(); + $table->string('owner_ref')->index(); + $table->foreignId('organization_id')->constrained('care_organizations')->cascadeOnDelete(); + $table->foreignId('branch_id')->nullable()->constrained('care_branches')->nullOnDelete(); + $table->foreignId('department_id')->nullable()->constrained('care_departments')->nullOnDelete(); + $table->foreignId('member_id')->nullable()->constrained('care_members')->nullOnDelete(); + $table->string('user_ref')->nullable()->index(); + $table->string('name'); + $table->string('specialty')->nullable(); + $table->boolean('is_active')->default(true); + $table->timestamps(); + $table->softDeletes(); + }); + + Schema::create('care_practitioner_schedules', function (Blueprint $table) { + $table->id(); + $table->string('owner_ref')->index(); + $table->foreignId('practitioner_id')->constrained('care_practitioners')->cascadeOnDelete(); + $table->unsignedTinyInteger('day_of_week'); // 0=Sunday … 6=Saturday + $table->time('start_time'); + $table->time('end_time'); + $table->timestamps(); + }); + + Schema::create('care_visits', function (Blueprint $table) { + $table->id(); + $table->uuid('uuid')->unique(); + $table->string('owner_ref')->index(); + $table->foreignId('organization_id')->constrained('care_organizations')->cascadeOnDelete(); + $table->foreignId('branch_id')->constrained('care_branches')->cascadeOnDelete(); + $table->foreignId('patient_id')->constrained('care_patients')->cascadeOnDelete(); + $table->string('status')->default('open'); // open, in_progress, completed + $table->timestamp('checked_in_at')->nullable(); + $table->timestamp('completed_at')->nullable(); + $table->string('checked_in_by')->nullable(); + $table->timestamps(); + $table->softDeletes(); + $table->index(['owner_ref', 'status']); + }); + + Schema::create('care_appointments', function (Blueprint $table) { + $table->id(); + $table->uuid('uuid')->unique(); + $table->string('owner_ref')->index(); + $table->foreignId('organization_id')->constrained('care_organizations')->cascadeOnDelete(); + $table->foreignId('branch_id')->constrained('care_branches')->cascadeOnDelete(); + $table->foreignId('patient_id')->constrained('care_patients')->cascadeOnDelete(); + $table->foreignId('practitioner_id')->nullable()->constrained('care_practitioners')->nullOnDelete(); + $table->foreignId('department_id')->nullable()->constrained('care_departments')->nullOnDelete(); + $table->foreignId('visit_id')->nullable()->constrained('care_visits')->nullOnDelete(); + $table->string('type')->default('scheduled'); // scheduled, walk_in + $table->string('status')->default('scheduled'); + $table->timestamp('scheduled_at')->nullable(); + $table->timestamp('checked_in_at')->nullable(); + $table->timestamp('waiting_at')->nullable(); + $table->timestamp('started_at')->nullable(); + $table->timestamp('completed_at')->nullable(); + $table->timestamp('cancelled_at')->nullable(); + $table->unsignedInteger('queue_position')->nullable(); + $table->text('reason')->nullable(); + $table->text('notes')->nullable(); + $table->string('created_by')->nullable(); + $table->timestamps(); + $table->softDeletes(); + $table->index(['branch_id', 'status', 'scheduled_at']); + }); + + Schema::create('care_consultations', function (Blueprint $table) { + $table->id(); + $table->uuid('uuid')->unique(); + $table->string('owner_ref')->index(); + $table->foreignId('visit_id')->constrained('care_visits')->cascadeOnDelete(); + $table->foreignId('appointment_id')->nullable()->constrained('care_appointments')->nullOnDelete(); + $table->foreignId('practitioner_id')->nullable()->constrained('care_practitioners')->nullOnDelete(); + $table->foreignId('patient_id')->constrained('care_patients')->cascadeOnDelete(); + $table->string('status')->default('draft'); // draft, completed + $table->text('symptoms')->nullable(); + $table->text('clinical_notes')->nullable(); + $table->timestamp('started_at')->nullable(); + $table->timestamp('completed_at')->nullable(); + $table->string('completed_by')->nullable(); + $table->timestamps(); + $table->softDeletes(); + }); + + Schema::create('care_vital_signs', function (Blueprint $table) { + $table->id(); + $table->string('owner_ref')->index(); + $table->foreignId('consultation_id')->constrained('care_consultations')->cascadeOnDelete(); + $table->unsignedSmallInteger('bp_systolic')->nullable(); + $table->unsignedSmallInteger('bp_diastolic')->nullable(); + $table->unsignedSmallInteger('pulse')->nullable(); + $table->decimal('temperature', 4, 1)->nullable(); + $table->decimal('weight_kg', 5, 2)->nullable(); + $table->decimal('height_cm', 5, 1)->nullable(); + $table->unsignedSmallInteger('spo2')->nullable(); + $table->unsignedSmallInteger('respiratory_rate')->nullable(); + $table->string('recorded_by')->nullable(); + $table->timestamp('recorded_at'); + $table->timestamps(); + }); + + Schema::create('care_diagnoses', function (Blueprint $table) { + $table->id(); + $table->string('owner_ref')->index(); + $table->foreignId('consultation_id')->constrained('care_consultations')->cascadeOnDelete(); + $table->string('code')->nullable(); + $table->string('description'); + $table->boolean('is_primary')->default(false); + $table->text('notes')->nullable(); + $table->timestamps(); + }); + + Schema::create('care_consultation_documents', function (Blueprint $table) { + $table->id(); + $table->string('owner_ref')->index(); + $table->foreignId('consultation_id')->constrained('care_consultations')->cascadeOnDelete(); + $table->string('file_path'); + $table->string('original_name'); + $table->string('mime_type')->nullable(); + $table->string('uploaded_by')->nullable(); + $table->timestamps(); + }); + } + + public function down(): void + { + Schema::dropIfExists('care_consultation_documents'); + Schema::dropIfExists('care_diagnoses'); + Schema::dropIfExists('care_vital_signs'); + Schema::dropIfExists('care_consultations'); + Schema::dropIfExists('care_appointments'); + Schema::dropIfExists('care_visits'); + Schema::dropIfExists('care_practitioner_schedules'); + Schema::dropIfExists('care_practitioners'); + } +}; diff --git a/database/migrations/2026_07_03_100000_create_care_lab_and_prescription_tables.php b/database/migrations/2026_07_03_100000_create_care_lab_and_prescription_tables.php new file mode 100644 index 0000000..5b4fcb6 --- /dev/null +++ b/database/migrations/2026_07_03_100000_create_care_lab_and_prescription_tables.php @@ -0,0 +1,144 @@ +id(); + $table->string('owner_ref')->index(); + $table->foreignId('organization_id')->constrained('care_organizations')->cascadeOnDelete(); + $table->string('name'); + $table->string('code')->nullable(); + $table->string('category')->default('blood'); // blood, urine, stool, xray, ultrasound, ct, mri, ecg, custom + $table->text('description')->nullable(); + $table->string('unit')->nullable(); + $table->decimal('reference_low', 12, 4)->nullable(); + $table->decimal('reference_high', 12, 4)->nullable(); + $table->string('reference_text')->nullable(); + $table->unsignedInteger('price_minor')->default(0); + $table->boolean('is_active')->default(true); + $table->timestamps(); + $table->softDeletes(); + $table->index(['organization_id', 'category']); + }); + + Schema::create('care_investigation_requests', function (Blueprint $table) { + $table->id(); + $table->uuid('uuid')->unique(); + $table->string('owner_ref')->index(); + $table->foreignId('organization_id')->constrained('care_organizations')->cascadeOnDelete(); + $table->foreignId('branch_id')->constrained('care_branches')->cascadeOnDelete(); + $table->foreignId('visit_id')->constrained('care_visits')->cascadeOnDelete(); + $table->foreignId('consultation_id')->nullable()->constrained('care_consultations')->nullOnDelete(); + $table->foreignId('patient_id')->constrained('care_patients')->cascadeOnDelete(); + $table->foreignId('investigation_type_id')->constrained('care_investigation_types')->cascadeOnDelete(); + $table->foreignId('practitioner_id')->nullable()->constrained('care_practitioners')->nullOnDelete(); + $table->string('status')->default('pending'); + $table->string('priority')->default('routine'); // routine, urgent + $table->text('clinical_notes')->nullable(); + $table->string('requested_by')->nullable(); + $table->foreignId('assigned_member_id')->nullable()->constrained('care_members')->nullOnDelete(); + $table->string('sample_barcode')->nullable(); + $table->timestamp('sample_collected_at')->nullable(); + $table->string('sample_collected_by')->nullable(); + $table->timestamp('completed_at')->nullable(); + $table->timestamp('delivered_at')->nullable(); + $table->string('approved_by')->nullable(); + $table->timestamp('approved_at')->nullable(); + $table->timestamps(); + $table->softDeletes(); + $table->index(['branch_id', 'status']); + $table->index(['patient_id', 'status']); + }); + + Schema::create('care_investigation_results', function (Blueprint $table) { + $table->id(); + $table->string('owner_ref')->index(); + $table->foreignId('investigation_request_id')->constrained('care_investigation_requests')->cascadeOnDelete(); + $table->text('result_summary')->nullable(); + $table->text('interpretation')->nullable(); + $table->boolean('is_abnormal')->default(false); + $table->string('status')->default('draft'); // draft, approved + $table->string('entered_by')->nullable(); + $table->string('approved_by')->nullable(); + $table->timestamp('approved_at')->nullable(); + $table->timestamps(); + }); + + Schema::create('care_investigation_result_values', function (Blueprint $table) { + $table->id(); + $table->string('owner_ref')->index(); + $table->foreignId('investigation_result_id')->constrained('care_investigation_results')->cascadeOnDelete(); + $table->string('parameter'); + $table->string('value')->nullable(); + $table->string('unit')->nullable(); + $table->decimal('reference_low', 12, 4)->nullable(); + $table->decimal('reference_high', 12, 4)->nullable(); + $table->string('reference_text')->nullable(); + $table->boolean('is_abnormal')->default(false); + $table->timestamps(); + }); + + Schema::create('care_investigation_attachments', function (Blueprint $table) { + $table->id(); + $table->string('owner_ref')->index(); + $table->foreignId('investigation_result_id')->constrained('care_investigation_results')->cascadeOnDelete(); + $table->string('file_path'); + $table->string('original_name'); + $table->string('mime_type')->nullable(); + $table->string('uploaded_by')->nullable(); + $table->timestamps(); + }); + + Schema::create('care_prescriptions', function (Blueprint $table) { + $table->id(); + $table->uuid('uuid')->unique(); + $table->string('owner_ref')->index(); + $table->foreignId('organization_id')->constrained('care_organizations')->cascadeOnDelete(); + $table->foreignId('visit_id')->constrained('care_visits')->cascadeOnDelete(); + $table->foreignId('consultation_id')->nullable()->constrained('care_consultations')->nullOnDelete(); + $table->foreignId('patient_id')->constrained('care_patients')->cascadeOnDelete(); + $table->foreignId('practitioner_id')->nullable()->constrained('care_practitioners')->nullOnDelete(); + $table->string('status')->default('draft'); // draft, active, dispensed, cancelled + $table->text('notes')->nullable(); + $table->string('prescribed_by')->nullable(); + $table->string('dispensed_by')->nullable(); + $table->timestamp('dispensed_at')->nullable(); + $table->timestamps(); + $table->softDeletes(); + $table->index(['patient_id', 'status']); + }); + + Schema::create('care_prescription_items', function (Blueprint $table) { + $table->id(); + $table->string('owner_ref')->index(); + $table->foreignId('prescription_id')->constrained('care_prescriptions')->cascadeOnDelete(); + $table->boolean('is_procedure')->default(false); + $table->string('name'); + $table->string('dosage')->nullable(); + $table->string('frequency')->nullable(); + $table->string('duration')->nullable(); + $table->string('route')->nullable(); + $table->string('quantity')->nullable(); + $table->text('instructions')->nullable(); + $table->unsignedSmallInteger('sort_order')->default(0); + $table->timestamps(); + }); + } + + public function down(): void + { + Schema::dropIfExists('care_prescription_items'); + Schema::dropIfExists('care_prescriptions'); + Schema::dropIfExists('care_investigation_attachments'); + Schema::dropIfExists('care_investigation_result_values'); + Schema::dropIfExists('care_investigation_results'); + Schema::dropIfExists('care_investigation_requests'); + Schema::dropIfExists('care_investigation_types'); + } +}; diff --git a/database/migrations/2026_07_04_100000_create_care_billing_pharmacy_tables.php b/database/migrations/2026_07_04_100000_create_care_billing_pharmacy_tables.php new file mode 100644 index 0000000..a9fc2c7 --- /dev/null +++ b/database/migrations/2026_07_04_100000_create_care_billing_pharmacy_tables.php @@ -0,0 +1,122 @@ +id(); + $table->uuid('uuid')->unique(); + $table->string('owner_ref')->index(); + $table->foreignId('organization_id')->constrained('care_organizations')->cascadeOnDelete(); + $table->foreignId('branch_id')->constrained('care_branches')->cascadeOnDelete(); + $table->foreignId('visit_id')->constrained('care_visits')->cascadeOnDelete(); + $table->foreignId('patient_id')->constrained('care_patients')->cascadeOnDelete(); + $table->string('invoice_number')->unique(); + $table->string('status')->default('open'); // draft, open, partial, paid, void + $table->unsignedInteger('subtotal_minor')->default(0); + $table->unsignedInteger('discount_minor')->default(0); + $table->unsignedInteger('tax_minor')->default(0); + $table->unsignedInteger('total_minor')->default(0); + $table->unsignedInteger('amount_paid_minor')->default(0); + $table->unsignedInteger('balance_minor')->default(0); + $table->text('notes')->nullable(); + $table->string('created_by')->nullable(); + $table->timestamp('finalized_at')->nullable(); + $table->timestamps(); + $table->softDeletes(); + $table->index(['patient_id', 'status']); + $table->index(['branch_id', 'status']); + }); + + Schema::create('care_bill_line_items', function (Blueprint $table) { + $table->id(); + $table->string('owner_ref')->index(); + $table->foreignId('bill_id')->constrained('care_bills')->cascadeOnDelete(); + $table->string('type')->default('misc'); // consultation, lab, imaging, procedure, pharmacy, nursing, misc + $table->string('description'); + $table->unsignedSmallInteger('quantity')->default(1); + $table->unsignedInteger('unit_price_minor')->default(0); + $table->unsignedInteger('total_minor')->default(0); + $table->string('source_type')->nullable(); + $table->unsignedBigInteger('source_id')->nullable(); + $table->timestamps(); + }); + + Schema::create('care_payments', function (Blueprint $table) { + $table->id(); + $table->uuid('uuid')->unique(); + $table->string('owner_ref')->index(); + $table->foreignId('bill_id')->constrained('care_bills')->cascadeOnDelete(); + $table->unsignedInteger('amount_minor'); + $table->string('method')->default('cash'); // cash, momo, card, other + $table->string('reference')->nullable(); + $table->timestamp('paid_at'); + $table->string('recorded_by')->nullable(); + $table->text('notes')->nullable(); + $table->timestamps(); + }); + + Schema::create('care_drugs', function (Blueprint $table) { + $table->id(); + $table->string('owner_ref')->index(); + $table->foreignId('organization_id')->constrained('care_organizations')->cascadeOnDelete(); + $table->foreignId('branch_id')->nullable()->constrained('care_branches')->nullOnDelete(); + $table->string('name'); + $table->string('generic_name')->nullable(); + $table->string('sku')->nullable(); + $table->string('unit')->default('unit'); + $table->unsignedInteger('unit_price_minor')->default(0); + $table->unsignedInteger('reorder_level')->default(10); + $table->boolean('is_active')->default(true); + $table->timestamps(); + $table->softDeletes(); + }); + + Schema::create('care_drug_batches', function (Blueprint $table) { + $table->id(); + $table->string('owner_ref')->index(); + $table->foreignId('drug_id')->constrained('care_drugs')->cascadeOnDelete(); + $table->string('batch_number'); + $table->date('expiry_date')->nullable(); + $table->unsignedInteger('quantity_on_hand')->default(0); + $table->unsignedInteger('cost_minor')->default(0); + $table->timestamp('received_at')->nullable(); + $table->timestamps(); + $table->index(['drug_id', 'expiry_date']); + }); + + Schema::create('care_dispensing_records', function (Blueprint $table) { + $table->id(); + $table->string('owner_ref')->index(); + $table->foreignId('prescription_id')->constrained('care_prescriptions')->cascadeOnDelete(); + $table->foreignId('prescription_item_id')->constrained('care_prescription_items')->cascadeOnDelete(); + $table->foreignId('drug_batch_id')->constrained('care_drug_batches')->cascadeOnDelete(); + $table->unsignedInteger('quantity'); + $table->string('dispensed_by')->nullable(); + $table->timestamp('dispensed_at'); + $table->timestamps(); + }); + + Schema::table('care_prescription_items', function (Blueprint $table) { + $table->foreignId('drug_id')->nullable()->after('prescription_id')->constrained('care_drugs')->nullOnDelete(); + }); + } + + public function down(): void + { + Schema::table('care_prescription_items', function (Blueprint $table) { + $table->dropConstrainedForeignId('drug_id'); + }); + Schema::dropIfExists('care_dispensing_records'); + Schema::dropIfExists('care_drug_batches'); + Schema::dropIfExists('care_drugs'); + Schema::dropIfExists('care_payments'); + Schema::dropIfExists('care_bill_line_items'); + Schema::dropIfExists('care_bills'); + } +}; diff --git a/deploy/bin/ladill-hosting-admin b/deploy/bin/ladill-hosting-admin new file mode 100755 index 0000000..88b5ff1 --- /dev/null +++ b/deploy/bin/ladill-hosting-admin @@ -0,0 +1,126 @@ +#!/usr/bin/env bash +set -euo pipefail + +usage() { + cat <<'EOF' >&2 +Usage: + ladill-hosting-admin self-check + ladill-hosting-admin mkdir + ladill-hosting-admin chown + ladill-hosting-admin chmod + ladill-hosting-admin write-file + ladill-hosting-admin symlink + ladill-hosting-admin nginx-test + ladill-hosting-admin reload-nginx + ladill-hosting-admin certbot-webroot + ladill-hosting-admin certbot-renew + ladill-hosting-admin run-cmd + ladill-hosting-admin read-file +EOF + exit 64 +} + +require_abs_path() { + local path="${1:-}" + + if [[ -z "$path" || "${path#/}" == "$path" ]]; then + echo "Expected an absolute path, got: $path" >&2 + exit 64 + fi +} + +ensure_domain() { + local value="${1:-}" + + if [[ ! "$value" =~ ^[A-Za-z0-9.-]+$ ]]; then + echo "Invalid domain: $value" >&2 + exit 64 + fi +} + +ensure_owner_group() { + local value="${1:-}" + + if [[ ! "$value" =~ ^[A-Za-z_][A-Za-z0-9_-]*:[A-Za-z_][A-Za-z0-9_-]*$ ]]; then + echo "Invalid owner:group value: $value" >&2 + exit 64 + fi +} + +ensure_mode() { + local value="${1:-}" + + if [[ ! "$value" =~ ^[0-7]{3,4}$ && ! "$value" =~ ^[ugoa,+-=rwxX]+$ ]]; then + echo "Invalid chmod mode: $value" >&2 + exit 64 + fi +} + +command="${1:-}" + +case "$command" in + self-check) + exit 0 + ;; + mkdir) + [[ $# -eq 2 ]] || usage + require_abs_path "$2" + exec mkdir -p "$2" + ;; + chown) + [[ $# -eq 3 ]] || usage + ensure_owner_group "$2" + require_abs_path "$3" + exec chown -R "$2" "$3" + ;; + chmod) + [[ $# -eq 3 ]] || usage + ensure_mode "$2" + require_abs_path "$3" + exec chmod "$2" "$3" + ;; + write-file) + [[ $# -eq 3 ]] || usage + require_abs_path "$2" + tmpfile="$(mktemp)" + trap 'rm -f "$tmpfile"' EXIT + printf '%s' "$3" | base64 --decode > "$tmpfile" + install -m 0644 "$tmpfile" "$2" + rm -f "$tmpfile" + trap - EXIT + ;; + symlink) + [[ $# -eq 3 ]] || usage + require_abs_path "$2" + require_abs_path "$3" + exec ln -sfn "$2" "$3" + ;; + nginx-test) + exec nginx -t + ;; + reload-nginx) + exec systemctl reload nginx + ;; + certbot-webroot) + [[ $# -eq 4 ]] || usage + ensure_domain "$3" + require_abs_path "$4" + exec certbot certonly --webroot --non-interactive --agree-tos --no-eff-email -m "$2" -w "$4" -d "$3" -d "www.$3" + ;; + certbot-renew) + exec certbot renew --quiet --no-random-sleep-on-renew + ;; + run-cmd) + [[ $# -ge 2 ]] || usage + shift + exec bash -c "$*" + ;; + read-file) + [[ $# -eq 2 ]] || usage + require_abs_path "$2" + exec cat "$2" + ;; + *) + usage + ;; +esac diff --git a/deploy/bin/ladill-hosting-user b/deploy/bin/ladill-hosting-user new file mode 100755 index 0000000..bc3a45a --- /dev/null +++ b/deploy/bin/ladill-hosting-user @@ -0,0 +1,21 @@ +#!/usr/bin/env bash +set -euo pipefail + +usage() { + echo "Usage: ladill-hosting-user " >&2 + exit 64 +} + +[[ $# -eq 2 ]] || usage + +username="$1" +payload_b64="$2" + +if [[ ! "$username" =~ ^[A-Za-z_][A-Za-z0-9_-]*$ ]]; then + echo "Invalid username: $username" >&2 + exit 64 +fi + +command="$(printf '%s' "$payload_b64" | base64 --decode)" + +exec runuser -u "$username" -- bash -lc "$command" diff --git a/deploy/deploy.sh b/deploy/deploy.sh new file mode 100755 index 0000000..b92bdcb --- /dev/null +++ b/deploy/deploy.sh @@ -0,0 +1,296 @@ +#!/usr/bin/env bash +# Fast on-host release deploy (same model as climpme/web/deploy/deploy.sh). +set -Eeuo pipefail + +APP_ROOT="${LADILL_APP_ROOT:-/var/www/ladill-care}" +RELEASES_DIR="$APP_ROOT/releases" +SHARED_DIR="$APP_ROOT/shared" +CURRENT_LINK="$APP_ROOT/current" +RELEASE_ARCHIVE="${LADILL_RELEASE_ARCHIVE:-/tmp/ladill-release.tgz}" +KEEP_RELEASES="${LADILL_KEEP_RELEASES:-5}" + +STAMP="$(date +%Y%m%d%H%M%S)" +NEW_RELEASE="$RELEASES_DIR/$STAMP" + +log() { + printf '[%s] %s\n' "$(date '+%F %T')" "$*" +} + +bootstrap_shared_env() { + local candidate="" + + if [ -f "$SHARED_DIR/.env" ]; then + return 0 + fi + + for candidate in "$CURRENT_LINK/.env" "$APP_ROOT/.env"; do + if [ -f "$candidate" ]; then + cp -fL "$candidate" "$SHARED_DIR/.env" + log "Bootstrapped shared .env from $candidate" + return 0 + fi + done + + return 1 +} + +ensure_writable_paths() { + local paths=("$@") + + [ "${#paths[@]}" -gt 0 ] || return 0 + + chmod -R ug+rwX "${paths[@]}" 2>/dev/null || true + + if command -v find >/dev/null 2>&1; then + find "${paths[@]}" -type d -exec chmod ug+rwx {} + 2>/dev/null || true + find "${paths[@]}" -type d -exec chmod g+s {} + 2>/dev/null || true + fi +} + +normalize_shared_permissions() { + local owner="${LADILL_DEPLOY_USER:-deploy}" + local group="${LADILL_DEPLOY_GROUP:-www-data}" + local shared_paths=("$SHARED_DIR/storage" "$SHARED_DIR/bootstrap-cache") + + id -u "$owner" >/dev/null 2>&1 || return 0 + getent group "$group" >/dev/null 2>&1 || return 0 + + if chown -R "$owner:$group" "${shared_paths[@]}" 2>/dev/null; then + : + elif command -v sudo >/dev/null 2>&1; then + sudo -n chown -R "$owner:$group" "${shared_paths[@]}" 2>/dev/null || true + fi + + ensure_writable_paths "${shared_paths[@]}" +} + +run_artisan() { + local command="$1" + + if [ -f "$NEW_RELEASE/artisan" ]; then + (cd "$NEW_RELEASE" && php artisan ${command}) + fi +} + +uses_sqlite() { + [ -f "$SHARED_DIR/.env" ] && grep -Eq '^DB_CONNECTION=sqlite([[:space:]]*)$' "$SHARED_DIR/.env" +} + +sqlite_database_setting() { + [ -f "$SHARED_DIR/.env" ] || return 1 + + grep -E '^DB_DATABASE=' "$SHARED_DIR/.env" | tail -n 1 | cut -d= -f2- | sed -e 's/^"//' -e 's/"$//' -e "s/^'//" -e "s/'$//" +} + +prepare_sqlite_database() { + local configured_path="" + local db_name="" + local shared_sqlite_path="" + local current_sqlite_path="" + local release_sqlite_path="" + + configured_path="$(sqlite_database_setting || true)" + [ -n "$configured_path" ] || configured_path="database/database.sqlite" + + if [[ "$configured_path" = /* ]]; then + shared_sqlite_path="$configured_path" + mkdir -p "$(dirname "$shared_sqlite_path")" + else + db_name="$(basename "$configured_path")" + shared_sqlite_path="$SHARED_DIR/database/$db_name" + current_sqlite_path="$CURRENT_LINK/$configured_path" + release_sqlite_path="$NEW_RELEASE/$configured_path" + + mkdir -p "$SHARED_DIR/database" "$(dirname "$release_sqlite_path")" + + if [ ! -f "$shared_sqlite_path" ]; then + if [ -f "$current_sqlite_path" ]; then + cp -fL "$current_sqlite_path" "$shared_sqlite_path" + log "Bootstrapped shared sqlite database from $current_sqlite_path" + elif [ -f "$APP_ROOT/$configured_path" ]; then + cp -fL "$APP_ROOT/$configured_path" "$shared_sqlite_path" + log "Bootstrapped shared sqlite database from $APP_ROOT/$configured_path" + else + touch "$shared_sqlite_path" + log "Created shared sqlite database at $shared_sqlite_path" + fi + fi + + rm -f "$release_sqlite_path" + ln -sfn "$shared_sqlite_path" "$release_sqlite_path" + ensure_writable_paths "$SHARED_DIR/database" + return 0 + fi + + if [ ! -f "$shared_sqlite_path" ]; then + touch "$shared_sqlite_path" + log "Created shared sqlite database at $shared_sqlite_path" + fi + + ensure_writable_paths "$(dirname "$shared_sqlite_path")" +} + +resolve_npm() { + if command -v npm >/dev/null 2>&1; then command -v npm; return 0; fi + local candidate + for candidate in "${NODE_ROOT:-/tmp/ladill-node-22-r1}/bin/npm" /tmp/ladill-node-*/bin/npm; do + [ -x "$candidate" ] && { echo "$candidate"; return 0; } + done + return 1 +} + +# Ensure compiled Vite assets exist in the release. CI builds them into the +# archive; this only (re)builds when the manifest is missing — e.g. a manual +# on-host deploy — so a release without assets is never promoted (which would +# make every @vite page 500). Runs before the current symlink is switched, so a +# failure here leaves the previous good release live. +build_frontend_assets() { + if [ -f "$NEW_RELEASE/public/build/manifest.json" ]; then + log "Frontend assets present — skipping vite build" + return 0 + fi + + [ -f "$NEW_RELEASE/package.json" ] || { log "No package.json — skipping vite build"; return 0; } + + local npm_bin + if ! npm_bin="$(resolve_npm)"; then + echo "ERROR: vite manifest missing and npm not found; cannot build frontend assets (pages would 500)." >&2 + return 1 + fi + + log "Building frontend assets with $npm_bin" + ( + cd "$NEW_RELEASE" + export PATH="$(dirname "$npm_bin"):$PATH" + if [ -f package-lock.json ]; then + npm ci --no-audit --no-fund + else + npm install --no-audit --no-fund + fi + npm run build + ) +} + +log "Preparing release $STAMP" +[ -f "$RELEASE_ARCHIVE" ] || { echo "Release archive not found: $RELEASE_ARCHIVE" >&2; exit 1; } + +mkdir -p "$RELEASES_DIR" "$SHARED_DIR" "$NEW_RELEASE" +tar -xzf "$RELEASE_ARCHIVE" -C "$NEW_RELEASE" +chmod -R u+rwX "$NEW_RELEASE" 2>/dev/null || true + +log "Linking shared paths" +mkdir -p "$SHARED_DIR/storage/"{app/public,app/private,framework/{cache/data,sessions,testing,views},logs} +mkdir -p "$SHARED_DIR/bootstrap-cache" +normalize_shared_permissions + +if bootstrap_shared_env; then + ln -sfn "$SHARED_DIR/.env" "$NEW_RELEASE/.env" +else + echo "Missing deployment environment file. Expected $SHARED_DIR/.env or an existing $CURRENT_LINK/.env / $APP_ROOT/.env to bootstrap from." >&2 + exit 1 +fi + +rm -rf "$NEW_RELEASE/storage" +ln -sfn "$SHARED_DIR/storage" "$NEW_RELEASE/storage" +mkdir -p "$NEW_RELEASE/bootstrap" +rm -rf "$NEW_RELEASE/bootstrap/cache" +ln -sfn "$SHARED_DIR/bootstrap-cache" "$NEW_RELEASE/bootstrap/cache" +normalize_shared_permissions + +if uses_sqlite; then + log "Preparing shared sqlite database" + prepare_sqlite_database + if id -u www-data >/dev/null 2>&1; then + chgrp www-data "$SHARED_DIR/database" 2>/dev/null || true + find "$SHARED_DIR/database" -type f -exec chgrp www-data {} + 2>/dev/null || true + find "$SHARED_DIR/database" -type d -exec chgrp www-data {} + 2>/dev/null || true + fi +fi + +log "Installing PHP dependencies" +if [ -f "$NEW_RELEASE/composer.json" ]; then + if [ "$(id -u)" -eq 0 ]; then + export COMPOSER_ALLOW_SUPERUSER=1 + fi + export COMPOSER_HOME="${COMPOSER_HOME:-/home/deploy/.composer}" + ( + cd "$NEW_RELEASE" + composer install \ + --no-dev \ + --prefer-dist \ + --no-interaction \ + --no-progress \ + --optimize-autoloader \ + --classmap-authoritative + ) +fi + +log "Ensuring frontend assets" +if ! build_frontend_assets; then + echo "Frontend asset build failed — keeping previous release live" >&2 + exit 1 +fi + +log "Running migrations" +if ! run_artisan "migrate --force"; then + log "Migration failed — clearing shared bootstrap cache" + run_artisan "optimize:clear" || true + exit 1 +fi + +switch_current_release() { + if ln -sfnT "$NEW_RELEASE" "$CURRENT_LINK" 2>/dev/null; then + return 0 + fi + + if command -v sudo >/dev/null 2>&1 && sudo -n ln -sfnT "$NEW_RELEASE" "$CURRENT_LINK"; then + return 0 + fi + + echo "Unable to update current release symlink at $CURRENT_LINK" >&2 + return 1 +} + +log "Switching current release" +if ! switch_current_release; then + echo "Failed to point $CURRENT_LINK at $NEW_RELEASE" >&2 + exit 1 +fi + +LIVE_REV="$(cat "$CURRENT_LINK/REVISION" 2>/dev/null || echo unknown)" +log "Live release: $STAMP (revision $LIVE_REV)" + +log "Optimizing Laravel" +if [ -L "$CURRENT_LINK" ] && [ -f "$CURRENT_LINK/artisan" ]; then + ( + cd "$CURRENT_LINK" + php artisan storage:link || true + php artisan optimize:clear || true + php artisan config:cache || true + php artisan route:cache || true + php artisan view:cache || true + ) +fi + +log "Reloading services" +if command -v systemctl >/dev/null 2>&1; then + systemctl reload php8.4-fpm 2>/dev/null || sudo -n systemctl reload php8.4-fpm + systemctl reload nginx 2>/dev/null || sudo -n systemctl reload nginx +fi + +log "Restarting queues" +if [ -L "$CURRENT_LINK" ] && [ -f "$CURRENT_LINK/artisan" ]; then + (cd "$CURRENT_LINK" && php artisan queue:restart) || true +fi +if command -v supervisorctl >/dev/null 2>&1; then + supervisorctl restart ladill-care-worker:* 2>/dev/null || true +fi + +log "Cleaning old releases" +mapfile -t OLD_RELEASES < <(ls -1dt "$RELEASES_DIR"/* 2>/dev/null | tail -n "+$((KEEP_RELEASES + 1))" || true) +if [ "${#OLD_RELEASES[@]}" -gt 0 ]; then + chmod -R u+rwX "${OLD_RELEASES[@]}" 2>/dev/null || true + rm -rf "${OLD_RELEASES[@]}" 2>/dev/null || true +fi + +log "Deploy completed: $STAMP" diff --git a/deploy/sudoers.ladill-hosting.example b/deploy/sudoers.ladill-hosting.example new file mode 100644 index 0000000..4dc5ce2 --- /dev/null +++ b/deploy/sudoers.ladill-hosting.example @@ -0,0 +1,7 @@ +# Replace `www-data` with the actual PHP-FPM/web user that runs the app. +# Install as `/etc/sudoers.d/ladill-hosting` with mode `0440`. +# +# These helpers are root-owned fixed entry points installed by the deploy script. + +www-data ALL=(root) NOPASSWD: /usr/local/bin/ladill-hosting-admin * +www-data ALL=(root) NOPASSWD: /usr/local/bin/ladill-hosting-user * diff --git a/deployment/setup-service-subdomain-nginx.sh b/deployment/setup-service-subdomain-nginx.sh new file mode 100755 index 0000000..afde633 --- /dev/null +++ b/deployment/setup-service-subdomain-nginx.sh @@ -0,0 +1,153 @@ +#!/usr/bin/env bash +# +# Provision an nginx vhost for one of Ladill's own service subdomains +# (auth./account./pay./qr./... .ladill.com), reusing the existing +# *.ladill.com wildcard TLS certificate. +# +# The monolith phase needs nothing here — the ladill.com vhost already +# serves *.ladill.com over the wildcard cert. Use this when a service gets +# its OWN app (separate Laravel app dir, or a backend on another host/port), +# so its subdomain stops falling through to the catch-all and routes to the +# real service instead. +# +# Idempotent + safe: writes to sites-available, validates with `nginx -t`, +# and only reloads on success (restores the previous config on failure). +# +# Usage: +# setup-service-subdomain-nginx.sh --app [--fpm ] +# setup-service-subdomain-nginx.sh --proxy +# +# Options: +# --app DIR Serve a Laravel app from DIR/public via PHP-FPM. +# --fpm SOCK PHP-FPM socket for --app (default: /run/php/php8.4-fpm-ladill.sock). +# --proxy URL Reverse-proxy the subdomain to URL (e.g. http://127.0.0.1:9001). +# --zone ZONE Apex zone (default: ladill.com). +# --cert NAME Let's Encrypt lineage under /etc/letsencrypt/live (default: ladill-wildcard). +# --dry-run Print the rendered vhost and exit without writing anything. +# +# Examples: +# setup-service-subdomain-nginx.sh auth --app /var/www/auth.ladill.com/current +# setup-service-subdomain-nginx.sh pay --proxy http://127.0.0.1:9002 +set -euo pipefail + +SUB="${1:-}"; shift || true +[ -n "$SUB" ] || { echo "ERROR: missing (e.g. 'auth')"; exit 2; } + +MODE=""; APP_DIR=""; PROXY_URL="" +FPM_SOCK="/run/php/php8.4-fpm-ladill.sock" +ZONE="ladill.com" +CERT="ladill-wildcard" +DRY_RUN=0 + +while [ $# -gt 0 ]; do + case "$1" in + --app) MODE="app"; APP_DIR="${2:?--app needs a dir}"; shift 2;; + --proxy) MODE="proxy"; PROXY_URL="${2:?--proxy needs a url}"; shift 2;; + --fpm) FPM_SOCK="${2:?}"; shift 2;; + --zone) ZONE="${2:?}"; shift 2;; + --cert) CERT="${2:?}"; shift 2;; + --dry-run) DRY_RUN=1; shift;; + *) echo "ERROR: unknown arg '$1'"; exit 2;; + esac +done + +[ -n "$MODE" ] || { echo "ERROR: choose a backend: --app or --proxy "; exit 2; } + +FQDN="${SUB}.${ZONE}" +CERT_DIR="/etc/letsencrypt/live/${CERT}" +WEBROOT="${APP_DIR:-/var/www/${ZONE}/current}/public" + +if [ "$MODE" = "app" ]; then + BODY=$(cat <> Backed up existing vhost to $BK" +fi + +printf '%s\n' "$VHOST" > "$AVAIL" +ln -sfn "$AVAIL" "$ENABLED" + +if nginx -t; then + systemctl reload nginx + echo ">> ${FQDN} vhost active (${MODE})." +else + echo "ERROR: nginx config test failed — rolling back." + if [ -n "${BK:-}" ] && [ -f "${BK:-}" ]; then + cp -a "$BK" "$AVAIL" + else + rm -f "$AVAIL" "$ENABLED" + fi + nginx -t && systemctl reload nginx || true + exit 1 +fi diff --git a/deployment/supervisor/ladill-care-worker.conf b/deployment/supervisor/ladill-care-worker.conf new file mode 100644 index 0000000..2b9d186 --- /dev/null +++ b/deployment/supervisor/ladill-care-worker.conf @@ -0,0 +1,14 @@ +[program:ladill-care-worker] +process_name=%(program_name)s_%(process_num)02d +command=php /var/www/ladill-care/current/artisan queue:work --sleep=3 --tries=3 --timeout=300 --max-time=3600 +autostart=true +autorestart=true +stopasgroup=true +killasgroup=true +user=deploy +numprocs=1 +redirect_stderr=true +stdout_logfile=/var/www/ladill-care/shared/storage/logs/worker.log +stdout_logfile_maxbytes=10MB +stdout_logfile_backups=5 +stopwaitsecs=3600 diff --git a/docs/openapi/care.yaml b/docs/openapi/care.yaml new file mode 100644 index 0000000..35eefac --- /dev/null +++ b/docs/openapi/care.yaml @@ -0,0 +1,31 @@ +openapi: 3.1.0 +info: + title: Ladill Care API + version: 1.0.0 + description: Healthcare management API at care.ladill.com +servers: + - url: https://care.ladill.com/api/v1 +paths: + /health: + get: + summary: Health check + servers: + - url: https://care.ladill.com/api + /patients: + get: + summary: List patients + post: + summary: Register patient + /appointments: + get: + summary: List appointments + post: + summary: Book appointment + /bills: + get: + summary: List bills + /drugs: + get: + summary: List pharmacy inventory + post: + summary: Add drug diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..c5d1065 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,2564 @@ +{ + "name": "ladill-frontdesk", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "dependencies": { + "@alpinejs/collapse": "^3.15.12", + "@tailwindcss/forms": "^0.5.11", + "alpinejs": "^3.15.12", + "html5-qrcode": "^2.3.8", + "qr-code-styling": "^1.9.2", + "qrcode-generator": "^2.0.4" + }, + "devDependencies": { + "@tailwindcss/vite": "^4.0.0", + "axios": "^1.11.0", + "concurrently": "^9.0.1", + "laravel-vite-plugin": "^2.0.0", + "tailwindcss": "^4.0.0", + "vite": "^7.0.7" + } + }, + "node_modules/@alpinejs/collapse": { + "version": "3.15.12", + "resolved": "https://registry.npmjs.org/@alpinejs/collapse/-/collapse-3.15.12.tgz", + "integrity": "sha512-BKNANLtNXuWYOSAnajSKLPjTsmHRNrv0ALFTbpmqt2/klHFooPhctSwkhFVPQb7rZ8BjEKHmNaBwnSbgtpk6xg==", + "license": "MIT" + }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.27.7.tgz", + "integrity": "sha512-EKX3Qwmhz1eMdEJokhALr0YiD0lhQNwDqkPYyPhiSwKrh7/4KRjQc04sZ8db+5DVVnZ1LmbNDI1uAMPEUBnQPg==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.27.7.tgz", + "integrity": "sha512-jbPXvB4Yj2yBV7HUfE2KHe4GJX51QplCN1pGbYjvsyCZbQmies29EoJbkEc+vYuU5o45AfQn37vZlyXy4YJ8RQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.27.7.tgz", + "integrity": "sha512-62dPZHpIXzvChfvfLJow3q5dDtiNMkwiRzPylSCfriLvZeq0a1bWChrGx/BbUbPwOrsWKMn8idSllklzBy+dgQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.27.7.tgz", + "integrity": "sha512-x5VpMODneVDb70PYV2VQOmIUUiBtY3D3mPBG8NxVk5CogneYhkR7MmM3yR/uMdITLrC1ml/NV1rj4bMJuy9MCg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.27.7.tgz", + "integrity": "sha512-5lckdqeuBPlKUwvoCXIgI2D9/ABmPq3Rdp7IfL70393YgaASt7tbju3Ac+ePVi3KDH6N2RqePfHnXkaDtY9fkw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.27.7.tgz", + "integrity": "sha512-rYnXrKcXuT7Z+WL5K980jVFdvVKhCHhUwid+dDYQpH+qu+TefcomiMAJpIiC2EM3Rjtq0sO3StMV/+3w3MyyqQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.27.7.tgz", + "integrity": "sha512-B48PqeCsEgOtzME2GbNM2roU29AMTuOIN91dsMO30t+Ydis3z/3Ngoj5hhnsOSSwNzS+6JppqWsuhTp6E82l2w==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.27.7.tgz", + "integrity": "sha512-jOBDK5XEjA4m5IJK3bpAQF9/Lelu/Z9ZcdhTRLf4cajlB+8VEhFFRjWgfy3M1O4rO2GQ/b2dLwCUGpiF/eATNQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.27.7.tgz", + "integrity": "sha512-RkT/YXYBTSULo3+af8Ib0ykH8u2MBh57o7q/DAs3lTJlyVQkgQvlrPTnjIzzRPQyavxtPtfg0EopvDyIt0j1rA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.27.7.tgz", + "integrity": "sha512-RZPHBoxXuNnPQO9rvjh5jdkRmVizktkT7TCDkDmQ0W2SwHInKCAV95GRuvdSvA7w4VMwfCjUiPwDi0ZO6Nfe9A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.27.7.tgz", + "integrity": "sha512-GA48aKNkyQDbd3KtkplYWT102C5sn/EZTY4XROkxONgruHPU72l+gW+FfF8tf2cFjeHaRbWpOYa/uRBz/Xq1Pg==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.27.7.tgz", + "integrity": "sha512-a4POruNM2oWsD4WKvBSEKGIiWQF8fZOAsycHOt6JBpZ+JN2n2JH9WAv56SOyu9X5IqAjqSIPTaJkqN8F7XOQ5Q==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.27.7.tgz", + "integrity": "sha512-KabT5I6StirGfIz0FMgl1I+R1H73Gp0ofL9A3nG3i/cYFJzKHhouBV5VWK1CSgKvVaG4q1RNpCTR2LuTVB3fIw==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.27.7.tgz", + "integrity": "sha512-gRsL4x6wsGHGRqhtI+ifpN/vpOFTQtnbsupUF5R5YTAg+y/lKelYR1hXbnBdzDjGbMYjVJLJTd2OFmMewAgwlQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.27.7.tgz", + "integrity": "sha512-hL25LbxO1QOngGzu2U5xeXtxXcW+/GvMN3ejANqXkxZ/opySAZMrc+9LY/WyjAan41unrR3YrmtTsUpwT66InQ==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.27.7.tgz", + "integrity": "sha512-2k8go8Ycu1Kb46vEelhu1vqEP+UeRVj2zY1pSuPdgvbd5ykAw82Lrro28vXUrRmzEsUV0NzCf54yARIK8r0fdw==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.27.7.tgz", + "integrity": "sha512-hzznmADPt+OmsYzw1EE33ccA+HPdIqiCRq7cQeL1Jlq2gb1+OyWBkMCrYGBJ+sxVzve2ZJEVeePbLM2iEIZSxA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-arm64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.27.7.tgz", + "integrity": "sha512-b6pqtrQdigZBwZxAn1UpazEisvwaIDvdbMbmrly7cDTMFnw/+3lVxxCTGOrkPVnsYIosJJXAsILG9XcQS+Yu6w==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.27.7.tgz", + "integrity": "sha512-OfatkLojr6U+WN5EDYuoQhtM+1xco+/6FSzJJnuWiUw5eVcicbyK3dq5EeV/QHT1uy6GoDhGbFpprUiHUYggrw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-arm64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.27.7.tgz", + "integrity": "sha512-AFuojMQTxAz75Fo8idVcqoQWEHIXFRbOc1TrVcFSgCZtQfSdc1RXgB3tjOn/krRHENUB4j00bfGjyl2mJrU37A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.27.7.tgz", + "integrity": "sha512-+A1NJmfM8WNDv5CLVQYJ5PshuRm/4cI6WMZRg1by1GwPIQPCTs1GLEUHwiiQGT5zDdyLiRM/l1G0Pv54gvtKIg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openharmony-arm64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.27.7.tgz", + "integrity": "sha512-+KrvYb/C8zA9CU/g0sR6w2RBw7IGc5J2BPnc3dYc5VJxHCSF1yNMxTV5LQ7GuKteQXZtspjFbiuW5/dOj7H4Yw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.27.7.tgz", + "integrity": "sha512-ikktIhFBzQNt/QDyOL580ti9+5mL/YZeUPKU2ivGtGjdTYoqz6jObj6nOMfhASpS4GU4Q/Clh1QtxWAvcYKamA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.27.7.tgz", + "integrity": "sha512-7yRhbHvPqSpRUV7Q20VuDwbjW5kIMwTHpptuUzV+AA46kiPze5Z7qgt6CLCK3pWFrHeNfDd1VKgyP4O+ng17CA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.27.7.tgz", + "integrity": "sha512-SmwKXe6VHIyZYbBLJrhOoCJRB/Z1tckzmgTLfFYOfpMAx63BJEaL9ExI8x7v0oAO3Zh6D/Oi1gVxEYr5oUCFhw==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.27.7.tgz", + "integrity": "sha512-56hiAJPhwQ1R4i+21FVF7V8kSD5zZTdHcVuRFMW0hn753vVfQN8xlx4uOPT4xoGH0Z/oVATuR82AiqSTDIpaHg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.13", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", + "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.0", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/remapping": { + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/remapping/-/remapping-2.3.5.tgz", + "integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", + "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==", + "dev": true, + "license": "MIT" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.31", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", + "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@rollup/rollup-android-arm-eabi": { + "version": "4.61.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.61.0.tgz", + "integrity": "sha512-dnxczajOqt0gesZlN5pGQ1s1imQVrsmCw5G2Ci4oM+0WvNz3pyRnlWrT7McoZIb8VlFwCawdmbWRmxRn7HI+VQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-android-arm64": { + "version": "4.61.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.61.0.tgz", + "integrity": "sha512-Bp3JpGP00Vu3f238ivRrjf7z3xSzVPXqCmaJYA9t2c+c8vKYvOzmXF7LkkeUalTEGd6cZcSWe+PFIP3Vy48fRg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-darwin-arm64": { + "version": "4.61.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.61.0.tgz", + "integrity": "sha512-zaYIpr670mUmmZ1tVzUFplbQbG7h3Gugx3L5FoqhsC2m/YnLlR1a7zVLmXNPy+iY1tFPEbNG+HHBXZGyId0G5w==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-darwin-x64": { + "version": "4.61.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.61.0.tgz", + "integrity": "sha512-+P49fvkv2dSoeevUW+lgZ/I2JHSsJCK1Lyjj7Cu6E4UHG4tS9XIefzIjo5qhgELjAclnen1rLzK2PMKJdo+Dyg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-freebsd-arm64": { + "version": "4.61.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.61.0.tgz", + "integrity": "sha512-l3FAAOyKJXH2ea6KNFN+MMgC/rnE94YGLXs2ehYqDcCoHt1DpvgWX75BhUJxN38XojP7Ul+4H8PRn7EdyqSDrw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-freebsd-x64": { + "version": "4.61.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.61.0.tgz", + "integrity": "sha512-VokPN3TSctKj65cyCNPaUh4vMFA8awxOot/0sp+4J7ZlNRKQEhXhawqPwajoi8H5ZFt61i0ugZJuTKXBjGJ17Q==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-linux-arm-gnueabihf": { + "version": "4.61.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.61.0.tgz", + "integrity": "sha512-DxH0P3wxm+Yzs/p3zrk9dw1rURu8p0Nv5+MRK/L7OtnLNg5rLZraSBFZ8iUXOd9f2BlhJyEpIZUH/emjq4UJ4g==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm-musleabihf": { + "version": "4.61.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.61.0.tgz", + "integrity": "sha512-T6ZvMNe84kAz6TBWHC7hGAoEtzP1LWYw/AqayGWEF6uISt3Abk/st06LqRD9THd7Xz3NxzurUpzAuEAUbZf+nw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-gnu": { + "version": "4.61.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.61.0.tgz", + "integrity": "sha512-q/4hzvQkDs8b4jIBab1pnLiiM0ayTZsN2amBFPDzuyZxjEd4wDwx0UJFYM3cOZzSf5Kw8fnWSprJzIBMkcR44Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-musl": { + "version": "4.61.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.61.0.tgz", + "integrity": "sha512-vvYWX3akdEAY6km+9wAqFDnk6pQsbJKVnj7xawcvs/+fdlYBGp+U+Qq/lLfpIxYIZvZLHMAKD9HLdacSx/r3dw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loong64-gnu": { + "version": "4.61.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.61.0.tgz", + "integrity": "sha512-DePa5cqOxDP/Zp0VOXpeWaGew5iIv5DXp9NYbzkX5PFQyWVX9184WCTh3hvr/7lhXo8ZVlbFLkz8+o/q1dU6gA==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loong64-musl": { + "version": "4.61.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.61.0.tgz", + "integrity": "sha512-LV8aWMB8UChglMCEzs7RkN0GsH29RJaLLqwm9fCIjlqwxQTiWAqNcc7wjBkH31hV0PU/yVxGYvrYsgfea2qw6g==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-ppc64-gnu": { + "version": "4.61.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.61.0.tgz", + "integrity": "sha512-QoNSnwQtaeNu5grdBbsL0tt1uyl5EnS8DA8Mr3nluMXbhdQNyhN+G4tBax7VCdxLKj8YJ0/4OO9Ho84jMnJtKA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-ppc64-musl": { + "version": "4.61.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.61.0.tgz", + "integrity": "sha512-/zZp5MKapIIApE8trN8qLGNSiRN9TUoaUZ1cmVu4XnVdd5LQLOXTtyi+vtfUbNnT3iyjzpPqYeKXmvJ+gJGYWw==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-gnu": { + "version": "4.61.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.61.0.tgz", + "integrity": "sha512-RbrzcD3aJ1k3UbtMRRBNwojdVVyXjuVAFTfn/xPa6EEl6GE9Sm/akPgFTb9aAC9pMKGJ6CtWxaGrqWcabH+ySg==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-musl": { + "version": "4.61.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.61.0.tgz", + "integrity": "sha512-ZF+onDsBso8PJf1XaG9lB+O9RnBpKGnY6OrzC4CSHrtC1jb6jWLTKK4bRqdoCXHd22gyr2hiYmEAm8Wns/BOCw==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-s390x-gnu": { + "version": "4.61.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.61.0.tgz", + "integrity": "sha512-Atk0aSIk5Zx2Wuh9dgRQgLP0Koc8hOeYpbWryMXyk8G8/HmPkwPPkMqIIDhrXHHYqfUzSJA/I7IWSBv8xSmRBA==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-gnu": { + "version": "4.61.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.61.0.tgz", + "integrity": "sha512-0uMOcf3eZ5K+K4cYHkdxShFMPlPXCOdfDFEFn9dNYAEEd2cVvmOfH7zFgRVoDgmtQ1m9k5q7qfrHzyMAubKYUA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-musl": { + "version": "4.61.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.61.0.tgz", + "integrity": "sha512-mvFtE4A/t/7hRJ7X8Ozmu8FsIkAUat2nzl12pgU337BRmq87AQUJztwHz2Zv5/tjo9/C95E66CK03SI/ToEDJw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-openbsd-x64": { + "version": "4.61.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.61.0.tgz", + "integrity": "sha512-z9b9+aTxvt8n2rNltMPvyaUfB8NJ+CVyOrGK/MdIKHx7B+lXmZpm/XbRsU7Rpf3fRqJ2uS6mBJiJveCtq8LHDg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ] + }, + "node_modules/@rollup/rollup-openharmony-arm64": { + "version": "4.61.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.61.0.tgz", + "integrity": "sha512-jXaXFqKMehsOc+g8R6oo33RRC6w07G9jDBxAE5eAKX7mOcCbZloYIPNhfG9Wl+P9O9IWHFO4OJgPi1Ml2qkt7w==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ] + }, + "node_modules/@rollup/rollup-win32-arm64-msvc": { + "version": "4.61.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.61.0.tgz", + "integrity": "sha512-OXNWVFocS2IA4+QplhTZZ2a+8hPZR7T8KuozsNmJKK8y7cp83StHvGksfHzPG3wczWTczyWHVQuqeiTUbjiyBg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-ia32-msvc": { + "version": "4.61.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.61.0.tgz", + "integrity": "sha512-AlAbNtBO637LxSldqV43z0FfXoGfl2TW1DgAg/bs7aQswFbDewz2SJm3BUhiGfbOVtW571xbc9p+REdxhyN/Eg==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-gnu": { + "version": "4.61.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.61.0.tgz", + "integrity": "sha512-QRSrQXyJ1M4tjNXdR0/G/IgV6lzfQQJYBjlWIEYkY2Xs86DRl/iEpQ4blMDjJxSl7n19eDKKXMg0AmuBVYy8pQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-msvc": { + "version": "4.61.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.61.0.tgz", + "integrity": "sha512-tkuFxhvKO/HlGd0VsINF6vHSYH8AF8W0TcNxKDK6JZmrehngFj78pToc8iemtnvwilDjs2G/qSzYFhe9U8q+fw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@tailwindcss/forms": { + "version": "0.5.11", + "resolved": "https://registry.npmjs.org/@tailwindcss/forms/-/forms-0.5.11.tgz", + "integrity": "sha512-h9wegbZDPurxG22xZSoWtdzc41/OlNEUQERNqI/0fOwa2aVlWGu7C35E/x6LDyD3lgtztFSSjKZyuVM0hxhbgA==", + "license": "MIT", + "dependencies": { + "mini-svg-data-uri": "^1.2.3" + }, + "peerDependencies": { + "tailwindcss": ">=3.0.0 || >= 3.0.0-alpha.1 || >= 4.0.0-alpha.20 || >= 4.0.0-beta.1" + } + }, + "node_modules/@tailwindcss/node": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@tailwindcss/node/-/node-4.3.0.tgz", + "integrity": "sha512-aFb4gUhFOgdh9AXo4IzBEOzBkkAxm9VigwDJnMIYv3lcfXCJVesNfbEaBl4BNgVRyid92AmdviqwBUBRKSeY3g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/remapping": "^2.3.5", + "enhanced-resolve": "^5.21.0", + "jiti": "^2.6.1", + "lightningcss": "1.32.0", + "magic-string": "^0.30.21", + "source-map-js": "^1.2.1", + "tailwindcss": "4.3.0" + } + }, + "node_modules/@tailwindcss/oxide": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide/-/oxide-4.3.0.tgz", + "integrity": "sha512-F7HZGBeN9I0/AuuJS5PwcD8xayx5ri5GhjYUDBEVYUkexyA/giwbDNjRVrxSezE3T250OU2K/wp/ltWx3UOefg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 20" + }, + "optionalDependencies": { + "@tailwindcss/oxide-android-arm64": "4.3.0", + "@tailwindcss/oxide-darwin-arm64": "4.3.0", + "@tailwindcss/oxide-darwin-x64": "4.3.0", + "@tailwindcss/oxide-freebsd-x64": "4.3.0", + "@tailwindcss/oxide-linux-arm-gnueabihf": "4.3.0", + "@tailwindcss/oxide-linux-arm64-gnu": "4.3.0", + "@tailwindcss/oxide-linux-arm64-musl": "4.3.0", + "@tailwindcss/oxide-linux-x64-gnu": "4.3.0", + "@tailwindcss/oxide-linux-x64-musl": "4.3.0", + "@tailwindcss/oxide-wasm32-wasi": "4.3.0", + "@tailwindcss/oxide-win32-arm64-msvc": "4.3.0", + "@tailwindcss/oxide-win32-x64-msvc": "4.3.0" + } + }, + "node_modules/@tailwindcss/oxide-android-arm64": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-android-arm64/-/oxide-android-arm64-4.3.0.tgz", + "integrity": "sha512-TJPiq67tKlLuObP6RkwvVGDoxCMBVtDgKkLfa/uyj7/FyxvQwHS+UOnVrXXgbEsfUaMgiVvC4KbJnRr26ho4Ng==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-darwin-arm64": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-darwin-arm64/-/oxide-darwin-arm64-4.3.0.tgz", + "integrity": "sha512-oMN/WZRb+SO37BmUElEgeEWuU8E/HXRkiODxJxLe1UTHVXLrdVSgfaJV7pSlhRGMSOiXLuxTIjfsF3wYvz8cgQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-darwin-x64": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-darwin-x64/-/oxide-darwin-x64-4.3.0.tgz", + "integrity": "sha512-N6CUmu4a6bKVADfw77p+iw6Yd9Q3OBhe0veaDX+QazfuVYlQsHfDgxBrsjQ/IW+zywL8mTrNd0SdJT/zgtvMdA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-freebsd-x64": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-freebsd-x64/-/oxide-freebsd-x64-4.3.0.tgz", + "integrity": "sha512-zDL5hBkQdH5C6MpqbK3gQAgP80tsMwSI26vjOzjJtNCMUo0lFgOItzHKBIupOZNQxt3ouPH7RPhvNhiTfCe5CQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-linux-arm-gnueabihf": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-arm-gnueabihf/-/oxide-linux-arm-gnueabihf-4.3.0.tgz", + "integrity": "sha512-R06HdNi7A7OEoMsf6d4tjZ71RCWnZQPHj2mnotSFURjNLdBC+cIgXQ7l81CqeoiQftjf6OOblxXMInMgN2VzMA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-linux-arm64-gnu": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-arm64-gnu/-/oxide-linux-arm64-gnu-4.3.0.tgz", + "integrity": "sha512-qTJHELX8jetjhRQHCLilkVLmybpzNQAtaI/gaoVoidn/ufbNDbAo8KlK2J+yPoc8wQxvDxCmh/5lr8nC1+lTbg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-linux-arm64-musl": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-arm64-musl/-/oxide-linux-arm64-musl-4.3.0.tgz", + "integrity": "sha512-Z6sukiQsngnWO+l39X4pPbiWT81IC+PLKF+PHxIlyZbGNb9MODfYlXEVlFvej5BOZInWX01kVyzeLvHsXhfczQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-linux-x64-gnu": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-x64-gnu/-/oxide-linux-x64-gnu-4.3.0.tgz", + "integrity": "sha512-DRNdQRpSGzRGfARVuVkxvM8Q12nh19l4BF/G7zGA1oe+9wcC6saFBHTISrpIcKzhiXtSrlSrluCfvMuledoCTQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-linux-x64-musl": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-x64-musl/-/oxide-linux-x64-musl-4.3.0.tgz", + "integrity": "sha512-Z0IADbDo8bh6I7h2IQMx601AdXBLfFpEdUotft86evd/8ZPflZe9COPO8Q1vw+pfLWIUo9zN/JGZvwuAJqduqg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-wasm32-wasi": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-wasm32-wasi/-/oxide-wasm32-wasi-4.3.0.tgz", + "integrity": "sha512-HNZGOUxEmElksYR7S6sC5jTeNGpobAsy9u7Gu0AskJ8/20FR9GqebUyB+HBcU/ax6BHuiuJi+Oda4B+YX6H1yA==", + "bundleDependencies": [ + "@napi-rs/wasm-runtime", + "@emnapi/core", + "@emnapi/runtime", + "@tybys/wasm-util", + "@emnapi/wasi-threads", + "tslib" + ], + "cpu": [ + "wasm32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@emnapi/core": "^1.10.0", + "@emnapi/runtime": "^1.10.0", + "@emnapi/wasi-threads": "^1.2.1", + "@napi-rs/wasm-runtime": "^1.1.4", + "@tybys/wasm-util": "^0.10.1", + "tslib": "^2.8.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@tailwindcss/oxide-win32-arm64-msvc": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-win32-arm64-msvc/-/oxide-win32-arm64-msvc-4.3.0.tgz", + "integrity": "sha512-Pe+RPVTi1T+qymuuRpcdvwSVZjnll/f7n8gBxMMh3xLTctMDKqpdfGimbMyioqtLhUYZxdJ9wGNhV7MKHvgZsQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-win32-x64-msvc": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-win32-x64-msvc/-/oxide-win32-x64-msvc-4.3.0.tgz", + "integrity": "sha512-Mvrf2kXW/yeW/OTezZlCGOirXRcUuLIBx/5Y12BaPM7wJoryG6dfS/NJL8aBPqtTEx/Vm4T4vKzFUcKDT+TKUA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/vite": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@tailwindcss/vite/-/vite-4.3.0.tgz", + "integrity": "sha512-t6J3OrB5Fc0ExuhohouH0fWUGMYL6PTLhW+E7zIk/pdbnJARZDCwjBznFnkh5ynRnIRSI4YjtTH0t6USjJISrw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@tailwindcss/node": "4.3.0", + "@tailwindcss/oxide": "4.3.0", + "tailwindcss": "4.3.0" + }, + "peerDependencies": { + "vite": "^5.2.0 || ^6 || ^7 || ^8" + } + }, + "node_modules/@types/estree": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.9.tgz", + "integrity": "sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==", + "dev": true, + "license": "MIT" + }, + "node_modules/@vue/reactivity": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.1.5.tgz", + "integrity": "sha512-1tdfLmNjWG6t/CsPldh+foumYFo3cpyCHgBYQ34ylaMsJ+SNHQ1kApMIa8jN+i593zQuaw3AdWH0nJTARzCFhg==", + "license": "MIT", + "dependencies": { + "@vue/shared": "3.1.5" + } + }, + "node_modules/@vue/shared": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.1.5.tgz", + "integrity": "sha512-oJ4F3TnvpXaQwZJNF3ZK+kLPHKarDmJjJ6jyzVNDKH9md1dptjC7lWR//jrGuLdek/U6iltWxqAnYOu8gCiOvA==", + "license": "MIT" + }, + "node_modules/agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "debug": "4" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/alpinejs": { + "version": "3.15.12", + "resolved": "https://registry.npmjs.org/alpinejs/-/alpinejs-3.15.12.tgz", + "integrity": "sha512-nJvPAQVNPdZZ0NrExJ/kzQco3ijR8LwvCOadQecllESiqT4NyZ/57sN9V2XyvhlBGAbmlKYgeWZvYdKq99ij/Q==", + "license": "MIT", + "dependencies": { + "@vue/reactivity": "~3.1.1" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/axios": { + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.17.0.tgz", + "integrity": "sha512-J8SwNxprqqpbfenehxWYXE7CW+wM1BB4w3+N+g+/Wx40xM4rsLrfPmHHxSWIxJLYDgSY/HqlFPIYb2/S3rxafw==", + "dev": true, + "license": "MIT", + "dependencies": { + "follow-redirects": "^1.16.0", + "form-data": "^4.0.5", + "https-proxy-agent": "^5.0.1", + "proxy-from-env": "^2.1.0" + } + }, + "node_modules/call-bind-apply-helpers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/chalk/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dev": true, + "license": "MIT", + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/concurrently": { + "version": "9.2.1", + "resolved": "https://registry.npmjs.org/concurrently/-/concurrently-9.2.1.tgz", + "integrity": "sha512-fsfrO0MxV64Znoy8/l1vVIjjHa29SZyyqPgQBwhiDcaW8wJc2W3XWVOGx4M3oJBnv/zdUZIIp1gDeS98GzP8Ng==", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "4.1.2", + "rxjs": "7.8.2", + "shell-quote": "1.8.3", + "supports-color": "8.1.1", + "tree-kill": "1.2.2", + "yargs": "17.7.2" + }, + "bin": { + "conc": "dist/bin/concurrently.js", + "concurrently": "dist/bin/concurrently.js" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/open-cli-tools/concurrently?sponsor=1" + } + }, + "node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/detect-libc": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", + "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=8" + } + }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, + "license": "MIT" + }, + "node_modules/enhanced-resolve": { + "version": "5.22.1", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.22.1.tgz", + "integrity": "sha512-6QEuw3zoX1SJQc7b87aBXke/no+mG2bTBgw29gWMQonLmpEkWoCAVkl+M49e48AZlWzxiDzDZzYdp6kobcyLww==", + "dev": true, + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.2.4", + "tapable": "^2.3.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-object-atoms": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.2.tgz", + "integrity": "sha512-HWcBoN6NileqtSydK2FqHbS/LoDd2pqrnQHLyJzBj4kOp/ky2MWMN694xOfkK8/SnUsW2DH7EfyVlydKCsm1Zw==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-set-tostringtag": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz", + "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/esbuild": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.27.7.tgz", + "integrity": "sha512-IxpibTjyVnmrIQo5aqNpCgoACA/dTKLTlhMHihVHhdkxKyPO1uBBthumT0rdHmcsk9uMonIWS0m4FljWzILh3w==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.27.7", + "@esbuild/android-arm": "0.27.7", + "@esbuild/android-arm64": "0.27.7", + "@esbuild/android-x64": "0.27.7", + "@esbuild/darwin-arm64": "0.27.7", + "@esbuild/darwin-x64": "0.27.7", + "@esbuild/freebsd-arm64": "0.27.7", + "@esbuild/freebsd-x64": "0.27.7", + "@esbuild/linux-arm": "0.27.7", + "@esbuild/linux-arm64": "0.27.7", + "@esbuild/linux-ia32": "0.27.7", + "@esbuild/linux-loong64": "0.27.7", + "@esbuild/linux-mips64el": "0.27.7", + "@esbuild/linux-ppc64": "0.27.7", + "@esbuild/linux-riscv64": "0.27.7", + "@esbuild/linux-s390x": "0.27.7", + "@esbuild/linux-x64": "0.27.7", + "@esbuild/netbsd-arm64": "0.27.7", + "@esbuild/netbsd-x64": "0.27.7", + "@esbuild/openbsd-arm64": "0.27.7", + "@esbuild/openbsd-x64": "0.27.7", + "@esbuild/openharmony-arm64": "0.27.7", + "@esbuild/sunos-x64": "0.27.7", + "@esbuild/win32-arm64": "0.27.7", + "@esbuild/win32-ia32": "0.27.7", + "@esbuild/win32-x64": "0.27.7" + } + }, + "node_modules/escalade": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/fdir": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", + "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/follow-redirects": { + "version": "1.16.0", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.16.0.tgz", + "integrity": "sha512-y5rN/uOsadFT/JfYwhxRS5R7Qce+g3zG97+JrtFZlC9klX/W5hD7iiLzScI4nZqUS7DNUdhPgw4xI8W2LuXlUw==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "license": "MIT", + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, + "node_modules/form-data": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.5.tgz", + "integrity": "sha512-8RipRLol37bNs2bhoV67fiTEvdTrbMUYcFTiy3+wuuOnUog2QBHCZWXDRijWQfAkhBj2Uf5UnVaiWwA5vdd82w==", + "dev": true, + "license": "MIT", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "es-set-tostringtag": "^2.1.0", + "hasown": "^2.0.2", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true, + "license": "ISC", + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/get-intrinsic": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "function-bind": "^1.1.2", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "dev": true, + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/has-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-tostringtag": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-symbols": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.4.tgz", + "integrity": "sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A==", + "dev": true, + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/html5-qrcode": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/html5-qrcode/-/html5-qrcode-2.3.8.tgz", + "integrity": "sha512-jsr4vafJhwoLVEDW3n1KvPnCCXWaQfRng0/EEYk1vNcQGcG/htAdhJX0be8YyqMoSz7+hZvOZSTAepsabiuhiQ==" + }, + "node_modules/https-proxy-agent": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/jiti": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/jiti/-/jiti-2.7.0.tgz", + "integrity": "sha512-AC/7JofJvZGrrneWNaEnJeOLUx+JlGt7tNa0wZiRPT4MY1wmfKjt2+6O2p2uz2+skll8OZZmJMNqeke7kKbNgQ==", + "dev": true, + "license": "MIT", + "bin": { + "jiti": "lib/jiti-cli.mjs" + } + }, + "node_modules/laravel-vite-plugin": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/laravel-vite-plugin/-/laravel-vite-plugin-2.1.0.tgz", + "integrity": "sha512-z+ck2BSV6KWtYcoIzk9Y5+p4NEjqM+Y4i8/H+VZRLq0OgNjW2DqyADquwYu5j8qRvaXwzNmfCWl1KrMlV1zpsg==", + "dev": true, + "license": "MIT", + "dependencies": { + "picocolors": "^1.0.0", + "vite-plugin-full-reload": "^1.1.0" + }, + "bin": { + "clean-orphaned-assets": "bin/clean.js" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "peerDependencies": { + "vite": "^7.0.0" + } + }, + "node_modules/lightningcss": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss/-/lightningcss-1.32.0.tgz", + "integrity": "sha512-NXYBzinNrblfraPGyrbPoD19C1h9lfI/1mzgWYvXUTe414Gz/X1FD2XBZSZM7rRTrMA8JL3OtAaGifrIKhQ5yQ==", + "dev": true, + "license": "MPL-2.0", + "dependencies": { + "detect-libc": "^2.0.3" + }, + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + }, + "optionalDependencies": { + "lightningcss-android-arm64": "1.32.0", + "lightningcss-darwin-arm64": "1.32.0", + "lightningcss-darwin-x64": "1.32.0", + "lightningcss-freebsd-x64": "1.32.0", + "lightningcss-linux-arm-gnueabihf": "1.32.0", + "lightningcss-linux-arm64-gnu": "1.32.0", + "lightningcss-linux-arm64-musl": "1.32.0", + "lightningcss-linux-x64-gnu": "1.32.0", + "lightningcss-linux-x64-musl": "1.32.0", + "lightningcss-win32-arm64-msvc": "1.32.0", + "lightningcss-win32-x64-msvc": "1.32.0" + } + }, + "node_modules/lightningcss-android-arm64": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-android-arm64/-/lightningcss-android-arm64-1.32.0.tgz", + "integrity": "sha512-YK7/ClTt4kAK0vo6w3X+Pnm0D2cf2vPHbhOXdoNti1Ga0al1P4TBZhwjATvjNwLEBCnKvjJc2jQgHXH0NEwlAg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-darwin-arm64": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-darwin-arm64/-/lightningcss-darwin-arm64-1.32.0.tgz", + "integrity": "sha512-RzeG9Ju5bag2Bv1/lwlVJvBE3q6TtXskdZLLCyfg5pt+HLz9BqlICO7LZM7VHNTTn/5PRhHFBSjk5lc4cmscPQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-darwin-x64": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-darwin-x64/-/lightningcss-darwin-x64-1.32.0.tgz", + "integrity": "sha512-U+QsBp2m/s2wqpUYT/6wnlagdZbtZdndSmut/NJqlCcMLTWp5muCrID+K5UJ6jqD2BFshejCYXniPDbNh73V8w==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-freebsd-x64": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-freebsd-x64/-/lightningcss-freebsd-x64-1.32.0.tgz", + "integrity": "sha512-JCTigedEksZk3tHTTthnMdVfGf61Fky8Ji2E4YjUTEQX14xiy/lTzXnu1vwiZe3bYe0q+SpsSH/CTeDXK6WHig==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm-gnueabihf": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm-gnueabihf/-/lightningcss-linux-arm-gnueabihf-1.32.0.tgz", + "integrity": "sha512-x6rnnpRa2GL0zQOkt6rts3YDPzduLpWvwAF6EMhXFVZXD4tPrBkEFqzGowzCsIWsPjqSK+tyNEODUBXeeVHSkw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm64-gnu": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-gnu/-/lightningcss-linux-arm64-gnu-1.32.0.tgz", + "integrity": "sha512-0nnMyoyOLRJXfbMOilaSRcLH3Jw5z9HDNGfT/gwCPgaDjnx0i8w7vBzFLFR1f6CMLKF8gVbebmkUN3fa/kQJpQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm64-musl": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-musl/-/lightningcss-linux-arm64-musl-1.32.0.tgz", + "integrity": "sha512-UpQkoenr4UJEzgVIYpI80lDFvRmPVg6oqboNHfoH4CQIfNA+HOrZ7Mo7KZP02dC6LjghPQJeBsvXhJod/wnIBg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-x64-gnu": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-gnu/-/lightningcss-linux-x64-gnu-1.32.0.tgz", + "integrity": "sha512-V7Qr52IhZmdKPVr+Vtw8o+WLsQJYCTd8loIfpDaMRWGUZfBOYEJeyJIkqGIDMZPwPx24pUMfwSxxI8phr/MbOA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-x64-musl": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-musl/-/lightningcss-linux-x64-musl-1.32.0.tgz", + "integrity": "sha512-bYcLp+Vb0awsiXg/80uCRezCYHNg1/l3mt0gzHnWV9XP1W5sKa5/TCdGWaR/zBM2PeF/HbsQv/j2URNOiVuxWg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-win32-arm64-msvc": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-win32-arm64-msvc/-/lightningcss-win32-arm64-msvc-1.32.0.tgz", + "integrity": "sha512-8SbC8BR40pS6baCM8sbtYDSwEVQd4JlFTOlaD3gWGHfThTcABnNDBda6eTZeqbofalIJhFx0qKzgHJmcPTnGdw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-win32-x64-msvc": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-win32-x64-msvc/-/lightningcss-win32-x64-msvc-1.32.0.tgz", + "integrity": "sha512-Amq9B/SoZYdDi1kFrojnoqPLxYhQ4Wo5XiL8EVJrVsB8ARoC1PWW6VGtT0WKCemjy8aC+louJnjS7U18x3b06Q==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/magic-string": { + "version": "0.30.21", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz", + "integrity": "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.5" + } + }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "dev": true, + "license": "MIT", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mini-svg-data-uri": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/mini-svg-data-uri/-/mini-svg-data-uri-1.4.4.tgz", + "integrity": "sha512-r9deDe9p5FJUPZAk3A59wGH7Ii9YrjjWw0jmw/liSbHl2CHiyXj6FcDXDu2K3TjVAXqiJdaw3xxwlZZr9E6nHg==", + "license": "MIT", + "bin": { + "mini-svg-data-uri": "cli.js" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/nanoid": { + "version": "3.3.12", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.12.tgz", + "integrity": "sha512-ZB9RH/39qpq5Vu6Y+NmUaFhQR6pp+M2Xt76XBnEwDaGcVAqhlvxrl3B2bKS5D3NH3QR76v3aSrKaF/Kiy7lEtQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "dev": true, + "license": "ISC" + }, + "node_modules/picomatch": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.4.tgz", + "integrity": "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/postcss": { + "version": "8.5.15", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.15.tgz", + "integrity": "sha512-FfR8sjd4em2T6fb3I2MwAJU7HWVMr9zba+enmQeeWFfCbm+UOC/0X4DS8XtpUTMwWMGbjKYP7xjfNekzyGmB3A==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "nanoid": "^3.3.12", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.1" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/proxy-from-env": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-2.1.0.tgz", + "integrity": "sha512-cJ+oHTW1VAEa8cJslgmUZrc+sjRKgAKl3Zyse6+PV38hZe/V6Z14TbCuXcan9F9ghlz4QrFr2c92TNF82UkYHA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + } + }, + "node_modules/qr-code-styling": { + "version": "1.9.2", + "resolved": "https://registry.npmjs.org/qr-code-styling/-/qr-code-styling-1.9.2.tgz", + "integrity": "sha512-RgJaZJ1/RrXJ6N0j7a+pdw3zMBmzZU4VN2dtAZf8ZggCfRB5stEQ3IoDNGaNhYY3nnZKYlYSLl5YkfWN5dPutg==", + "license": "MIT", + "dependencies": { + "qrcode-generator": "^1.4.4" + }, + "engines": { + "node": ">=18.18.0" + } + }, + "node_modules/qr-code-styling/node_modules/qrcode-generator": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/qrcode-generator/-/qrcode-generator-1.5.2.tgz", + "integrity": "sha512-pItrW0Z9HnDBnFmgiNrY1uxRdri32Uh9EjNYLPVC2zZ3ZRIIEqBoDgm4DkvDwNNDHTK7FNkmr8zAa77BYc9xNw==", + "license": "MIT" + }, + "node_modules/qrcode-generator": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/qrcode-generator/-/qrcode-generator-2.0.4.tgz", + "integrity": "sha512-mZSiP6RnbHl4xL2Ap5HfkjLnmxfKcPWpWe/c+5XxCuetEenqmNFf1FH/ftXPCtFG5/TDobjsjz6sSNL0Sr8Z9g==", + "license": "MIT" + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/rollup": { + "version": "4.61.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.61.0.tgz", + "integrity": "sha512-T9mWdbWfQtp0B5lv/HX+wrhYsmXRlcWnXXmJbXqKJhlRaoS6KMhq0gpyzW4UJfclcxrEdLnTgjT2NjruLONu0g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "1.0.9" + }, + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=18.0.0", + "npm": ">=8.0.0" + }, + "optionalDependencies": { + "@rollup/rollup-android-arm-eabi": "4.61.0", + "@rollup/rollup-android-arm64": "4.61.0", + "@rollup/rollup-darwin-arm64": "4.61.0", + "@rollup/rollup-darwin-x64": "4.61.0", + "@rollup/rollup-freebsd-arm64": "4.61.0", + "@rollup/rollup-freebsd-x64": "4.61.0", + "@rollup/rollup-linux-arm-gnueabihf": "4.61.0", + "@rollup/rollup-linux-arm-musleabihf": "4.61.0", + "@rollup/rollup-linux-arm64-gnu": "4.61.0", + "@rollup/rollup-linux-arm64-musl": "4.61.0", + "@rollup/rollup-linux-loong64-gnu": "4.61.0", + "@rollup/rollup-linux-loong64-musl": "4.61.0", + "@rollup/rollup-linux-ppc64-gnu": "4.61.0", + "@rollup/rollup-linux-ppc64-musl": "4.61.0", + "@rollup/rollup-linux-riscv64-gnu": "4.61.0", + "@rollup/rollup-linux-riscv64-musl": "4.61.0", + "@rollup/rollup-linux-s390x-gnu": "4.61.0", + "@rollup/rollup-linux-x64-gnu": "4.61.0", + "@rollup/rollup-linux-x64-musl": "4.61.0", + "@rollup/rollup-openbsd-x64": "4.61.0", + "@rollup/rollup-openharmony-arm64": "4.61.0", + "@rollup/rollup-win32-arm64-msvc": "4.61.0", + "@rollup/rollup-win32-ia32-msvc": "4.61.0", + "@rollup/rollup-win32-x64-gnu": "4.61.0", + "@rollup/rollup-win32-x64-msvc": "4.61.0", + "fsevents": "~2.3.2" + } + }, + "node_modules/rxjs": { + "version": "7.8.2", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.2.tgz", + "integrity": "sha512-dhKf903U/PQZY6boNNtAGdWbG85WAbjT/1xYoZIC7FAY0yWapOBQVsVrDl58W86//e1VpMNBtRV4MaXfdMySFA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.1.0" + } + }, + "node_modules/shell-quote": { + "version": "1.8.3", + "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.8.3.tgz", + "integrity": "sha512-ObmnIF4hXNg1BqhnHmgbDETF8dLPCggZWBjkQfhZpbszZnYur5DUljTcCHii5LC3J5E0yeO/1LIMyH+UvHQgyw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/source-map-js": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", + "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/tailwindcss": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-4.3.0.tgz", + "integrity": "sha512-y6nxMGB1nMW9R6k96e5gdIFzcfL/gTJRNaqGes1YvkLnPVXzWgbqFF2yLC0T8G774n24cx3Pe8XrKoniCOAH+Q==", + "license": "MIT" + }, + "node_modules/tapable": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.3.3.tgz", + "integrity": "sha512-uxc/zpqFg6x7C8vOE7lh6Lbda8eEL9zmVm/PLeTPBRhh1xCgdWaQ+J1CUieGpIfm2HdtsUpRv+HshiasBMcc6A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + } + }, + "node_modules/tinyglobby": { + "version": "0.2.17", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.17.tgz", + "integrity": "sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==", + "dev": true, + "license": "MIT", + "dependencies": { + "fdir": "^6.5.0", + "picomatch": "^4.0.4" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/SuperchupuDev" + } + }, + "node_modules/tree-kill": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz", + "integrity": "sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==", + "dev": true, + "license": "MIT", + "bin": { + "tree-kill": "cli.js" + } + }, + "node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "dev": true, + "license": "0BSD" + }, + "node_modules/vite": { + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/vite/-/vite-7.3.5.tgz", + "integrity": "sha512-KuOaNhcnGFN2zIPGA7wRmzF+lJA1sea7rHq17aiJ++9lzY1WWG6Jpwqwe1KNbRVPIqHmr8GLYx7jbrQcN/7/ww==", + "dev": true, + "license": "MIT", + "dependencies": { + "esbuild": "^0.27.0", + "fdir": "^6.5.0", + "picomatch": "^4.0.3", + "postcss": "^8.5.6", + "rollup": "^4.43.0", + "tinyglobby": "^0.2.15" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^20.19.0 || >=22.12.0", + "jiti": ">=1.21.0", + "less": "^4.0.0", + "lightningcss": "^1.21.0", + "sass": "^1.70.0", + "sass-embedded": "^1.70.0", + "stylus": ">=0.54.8", + "sugarss": "^5.0.0", + "terser": "^5.16.0", + "tsx": "^4.8.1", + "yaml": "^2.4.2" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "jiti": { + "optional": true + }, + "less": { + "optional": true + }, + "lightningcss": { + "optional": true + }, + "sass": { + "optional": true + }, + "sass-embedded": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + }, + "tsx": { + "optional": true + }, + "yaml": { + "optional": true + } + } + }, + "node_modules/vite-plugin-full-reload": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/vite-plugin-full-reload/-/vite-plugin-full-reload-1.2.0.tgz", + "integrity": "sha512-kz18NW79x0IHbxRSHm0jttP4zoO9P9gXh+n6UTwlNKnviTTEpOlum6oS9SmecrTtSr+muHEn5TUuC75UovQzcA==", + "dev": true, + "license": "MIT", + "dependencies": { + "picocolors": "^1.0.0", + "picomatch": "^2.3.1" + } + }, + "node_modules/vite-plugin-full-reload/node_modules/picomatch": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.2.tgz", + "integrity": "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=10" + } + }, + "node_modules/yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "dev": true, + "license": "MIT", + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=12" + } + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..15dfc22 --- /dev/null +++ b/package.json @@ -0,0 +1,25 @@ +{ + "$schema": "https://www.schemastore.org/package.json", + "private": true, + "type": "module", + "scripts": { + "build": "vite build", + "dev": "vite" + }, + "devDependencies": { + "@tailwindcss/vite": "^4.0.0", + "axios": "^1.11.0", + "concurrently": "^9.0.1", + "laravel-vite-plugin": "^2.0.0", + "tailwindcss": "^4.0.0", + "vite": "^7.0.7" + }, + "dependencies": { + "@alpinejs/collapse": "^3.15.12", + "@tailwindcss/forms": "^0.5.11", + "alpinejs": "^3.15.12", + "html5-qrcode": "^2.3.8", + "qr-code-styling": "^1.9.2", + "qrcode-generator": "^2.0.4" + } +} diff --git a/phpunit.xml b/phpunit.xml new file mode 100644 index 0000000..973fa99 --- /dev/null +++ b/phpunit.xml @@ -0,0 +1,38 @@ + + + + + tests/Unit + + + tests/Feature + + + + + app + + + + + + + + + + + + + + + + + + + + + diff --git a/public/.htaccess b/public/.htaccess new file mode 100644 index 0000000..b574a59 --- /dev/null +++ b/public/.htaccess @@ -0,0 +1,25 @@ + + + Options -MultiViews -Indexes + + + RewriteEngine On + + # Handle Authorization Header + RewriteCond %{HTTP:Authorization} . + RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] + + # Handle X-XSRF-Token Header + RewriteCond %{HTTP:x-xsrf-token} . + RewriteRule .* - [E=HTTP_X_XSRF_TOKEN:%{HTTP:X-XSRF-Token}] + + # Redirect Trailing Slashes If Not A Folder... + RewriteCond %{REQUEST_FILENAME} !-d + RewriteCond %{REQUEST_URI} (.+)/$ + RewriteRule ^ %1 [L,R=301] + + # Send Requests To Front Controller... + RewriteCond %{REQUEST_FILENAME} !-d + RewriteCond %{REQUEST_FILENAME} !-f + RewriteRule ^ index.php [L] + diff --git a/public/favicon.ico b/public/favicon.ico new file mode 100644 index 0000000..3e89453 Binary files /dev/null and b/public/favicon.ico differ diff --git a/public/images/ladill-icons/bird.svg b/public/images/ladill-icons/bird.svg new file mode 100644 index 0000000..ad8a1a1 --- /dev/null +++ b/public/images/ladill-icons/bird.svg @@ -0,0 +1,20 @@ + + + + + + + + \ No newline at end of file diff --git a/public/images/ladill-icons/domains.svg b/public/images/ladill-icons/domains.svg new file mode 100644 index 0000000..ba4956e --- /dev/null +++ b/public/images/ladill-icons/domains.svg @@ -0,0 +1,20 @@ + + + + + + + + \ No newline at end of file diff --git a/public/images/ladill-icons/events.svg b/public/images/ladill-icons/events.svg new file mode 100644 index 0000000..6465988 --- /dev/null +++ b/public/images/ladill-icons/events.svg @@ -0,0 +1,2 @@ + + diff --git a/public/images/ladill-icons/pro.svg b/public/images/ladill-icons/pro.svg new file mode 100644 index 0000000..8ab5fc4 --- /dev/null +++ b/public/images/ladill-icons/pro.svg @@ -0,0 +1,3 @@ + + + diff --git a/public/images/ladill-icons/qrplus.svg b/public/images/ladill-icons/qrplus.svg new file mode 100644 index 0000000..023c58d --- /dev/null +++ b/public/images/ladill-icons/qrplus.svg @@ -0,0 +1,25 @@ + + + + + + + + + \ No newline at end of file diff --git a/public/images/ladill-icons/server.svg b/public/images/ladill-icons/server.svg new file mode 100644 index 0000000..5fbb2ac --- /dev/null +++ b/public/images/ladill-icons/server.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/images/ladill-icons/wordpress.svg b/public/images/ladill-icons/wordpress.svg new file mode 100644 index 0000000..0be90e4 --- /dev/null +++ b/public/images/ladill-icons/wordpress.svg @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/images/launcher-icons/accounting.svg b/public/images/launcher-icons/accounting.svg new file mode 100644 index 0000000..68b5263 --- /dev/null +++ b/public/images/launcher-icons/accounting.svg @@ -0,0 +1,25 @@ + + + + + + + + + \ No newline at end of file diff --git a/public/images/launcher-icons/bird.svg b/public/images/launcher-icons/bird.svg new file mode 100644 index 0000000..ba4956e --- /dev/null +++ b/public/images/launcher-icons/bird.svg @@ -0,0 +1,20 @@ + + + + + + + + \ No newline at end of file diff --git a/public/images/launcher-icons/care.svg b/public/images/launcher-icons/care.svg new file mode 100644 index 0000000..3a6ef95 --- /dev/null +++ b/public/images/launcher-icons/care.svg @@ -0,0 +1,25 @@ + + + + + + + + + \ No newline at end of file diff --git a/public/images/launcher-icons/crm.svg b/public/images/launcher-icons/crm.svg new file mode 100644 index 0000000..5a15828 --- /dev/null +++ b/public/images/launcher-icons/crm.svg @@ -0,0 +1,35 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/public/images/launcher-icons/domains.svg b/public/images/launcher-icons/domains.svg new file mode 100644 index 0000000..ad8a1a1 --- /dev/null +++ b/public/images/launcher-icons/domains.svg @@ -0,0 +1,20 @@ + + + + + + + + \ No newline at end of file diff --git a/public/images/launcher-icons/email.svg b/public/images/launcher-icons/email.svg new file mode 100644 index 0000000..72877c8 --- /dev/null +++ b/public/images/launcher-icons/email.svg @@ -0,0 +1,25 @@ + + + + + + + + + \ No newline at end of file diff --git a/public/images/launcher-icons/events.svg b/public/images/launcher-icons/events.svg new file mode 100644 index 0000000..feb13f8 --- /dev/null +++ b/public/images/launcher-icons/events.svg @@ -0,0 +1,21 @@ + + + + + + + + + \ No newline at end of file diff --git a/public/images/launcher-icons/frontdesk.svg b/public/images/launcher-icons/frontdesk.svg new file mode 100644 index 0000000..ea54262 --- /dev/null +++ b/public/images/launcher-icons/frontdesk.svg @@ -0,0 +1,25 @@ + + + + + + + + + \ No newline at end of file diff --git a/public/images/launcher-icons/give.svg b/public/images/launcher-icons/give.svg new file mode 100644 index 0000000..8985473 --- /dev/null +++ b/public/images/launcher-icons/give.svg @@ -0,0 +1,20 @@ + + + + + + + + \ No newline at end of file diff --git a/public/images/launcher-icons/hosting.svg b/public/images/launcher-icons/hosting.svg new file mode 100644 index 0000000..bd7b96f --- /dev/null +++ b/public/images/launcher-icons/hosting.svg @@ -0,0 +1,40 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/public/images/launcher-icons/invoice.svg b/public/images/launcher-icons/invoice.svg new file mode 100644 index 0000000..8c0e070 --- /dev/null +++ b/public/images/launcher-icons/invoice.svg @@ -0,0 +1,25 @@ + + + + + + + + + \ No newline at end of file diff --git a/public/images/launcher-icons/link.svg b/public/images/launcher-icons/link.svg new file mode 100644 index 0000000..4122dc4 --- /dev/null +++ b/public/images/launcher-icons/link.svg @@ -0,0 +1,25 @@ + + + + + + + + + \ No newline at end of file diff --git a/public/images/launcher-icons/mail.svg b/public/images/launcher-icons/mail.svg new file mode 100644 index 0000000..17ee6ca --- /dev/null +++ b/public/images/launcher-icons/mail.svg @@ -0,0 +1,25 @@ + + + + + + + + + \ No newline at end of file diff --git a/public/images/launcher-icons/merchant.svg b/public/images/launcher-icons/merchant.svg new file mode 100644 index 0000000..5029df3 --- /dev/null +++ b/public/images/launcher-icons/merchant.svg @@ -0,0 +1,25 @@ + + + + + + + + + \ No newline at end of file diff --git a/public/images/launcher-icons/mini.svg b/public/images/launcher-icons/mini.svg new file mode 100644 index 0000000..62957e6 --- /dev/null +++ b/public/images/launcher-icons/mini.svg @@ -0,0 +1,25 @@ + + + + + + + + + \ No newline at end of file diff --git a/public/images/launcher-icons/pos.svg b/public/images/launcher-icons/pos.svg new file mode 100644 index 0000000..3bdb6c6 --- /dev/null +++ b/public/images/launcher-icons/pos.svg @@ -0,0 +1,30 @@ + + + + + + + + + + \ No newline at end of file diff --git a/public/images/launcher-icons/qrplus.svg b/public/images/launcher-icons/qrplus.svg new file mode 100644 index 0000000..023c58d --- /dev/null +++ b/public/images/launcher-icons/qrplus.svg @@ -0,0 +1,25 @@ + + + + + + + + + \ No newline at end of file diff --git a/public/images/launcher-icons/servers.svg b/public/images/launcher-icons/servers.svg new file mode 100644 index 0000000..169dc36 --- /dev/null +++ b/public/images/launcher-icons/servers.svg @@ -0,0 +1,35 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/public/images/launcher-icons/sms.svg b/public/images/launcher-icons/sms.svg new file mode 100644 index 0000000..bc628c1 --- /dev/null +++ b/public/images/launcher-icons/sms.svg @@ -0,0 +1,25 @@ + + + + + + + + + \ No newline at end of file diff --git a/public/images/launcher-icons/transfer.svg b/public/images/launcher-icons/transfer.svg new file mode 100644 index 0000000..1a18372 --- /dev/null +++ b/public/images/launcher-icons/transfer.svg @@ -0,0 +1,25 @@ + + + + + + + + + \ No newline at end of file diff --git a/public/images/logo/ladillcare-logo.svg b/public/images/logo/ladillcare-logo.svg new file mode 100644 index 0000000..38cde08 --- /dev/null +++ b/public/images/logo/ladillcare-logo.svg @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/images/logo/ladillcrm-logo.svg b/public/images/logo/ladillcrm-logo.svg new file mode 100644 index 0000000..1fc582f --- /dev/null +++ b/public/images/logo/ladillcrm-logo.svg @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/images/logo/ladilldomains-logo-white.svg b/public/images/logo/ladilldomains-logo-white.svg new file mode 100644 index 0000000..0ba849c --- /dev/null +++ b/public/images/logo/ladilldomains-logo-white.svg @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/images/logo/ladilldomains-logo.svg b/public/images/logo/ladilldomains-logo.svg new file mode 100644 index 0000000..72e4745 --- /dev/null +++ b/public/images/logo/ladilldomains-logo.svg @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/images/logo/ladillemail-logo.svg b/public/images/logo/ladillemail-logo.svg new file mode 100644 index 0000000..f5d4f15 --- /dev/null +++ b/public/images/logo/ladillemail-logo.svg @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/images/logo/ladillevents-logo.svg b/public/images/logo/ladillevents-logo.svg new file mode 100644 index 0000000..e23909f --- /dev/null +++ b/public/images/logo/ladillevents-logo.svg @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/images/logo/ladillfrontdesk-logo.svg b/public/images/logo/ladillfrontdesk-logo.svg new file mode 100644 index 0000000..0008bdf --- /dev/null +++ b/public/images/logo/ladillfrontdesk-logo.svg @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/images/logo/ladillhosting-logo.svg b/public/images/logo/ladillhosting-logo.svg new file mode 100644 index 0000000..6a66d01 --- /dev/null +++ b/public/images/logo/ladillhosting-logo.svg @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/images/logo/ladillinvoice-logo.svg b/public/images/logo/ladillinvoice-logo.svg new file mode 100644 index 0000000..991b473 --- /dev/null +++ b/public/images/logo/ladillinvoice-logo.svg @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/images/logo/ladillmini-logo-email.png b/public/images/logo/ladillmini-logo-email.png new file mode 100644 index 0000000..c22d791 Binary files /dev/null and b/public/images/logo/ladillmini-logo-email.png differ diff --git a/public/images/logo/ladillmini-logo.svg b/public/images/logo/ladillmini-logo.svg new file mode 100644 index 0000000..76652b5 --- /dev/null +++ b/public/images/logo/ladillmini-logo.svg @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/images/logo/ladillqrplus-logo-white.svg b/public/images/logo/ladillqrplus-logo-white.svg new file mode 100644 index 0000000..3ea536b --- /dev/null +++ b/public/images/logo/ladillqrplus-logo-white.svg @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/images/logo/ladillqrplus-logo.svg b/public/images/logo/ladillqrplus-logo.svg new file mode 100644 index 0000000..d9b81fd --- /dev/null +++ b/public/images/logo/ladillqrplus-logo.svg @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/images/qr-icons/app.svg b/public/images/qr-icons/app.svg new file mode 100644 index 0000000..cf2c12f --- /dev/null +++ b/public/images/qr-icons/app.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/public/images/qr-icons/business-profile.svg b/public/images/qr-icons/business-profile.svg new file mode 100644 index 0000000..77284d8 --- /dev/null +++ b/public/images/qr-icons/business-profile.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/public/images/qr-icons/facebook.svg b/public/images/qr-icons/facebook.svg new file mode 100644 index 0000000..94a3b7b --- /dev/null +++ b/public/images/qr-icons/facebook.svg @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/images/qr-icons/instagram.svg b/public/images/qr-icons/instagram.svg new file mode 100644 index 0000000..658eb6e --- /dev/null +++ b/public/images/qr-icons/instagram.svg @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/images/qr-icons/linkedin.svg b/public/images/qr-icons/linkedin.svg new file mode 100644 index 0000000..875694f --- /dev/null +++ b/public/images/qr-icons/linkedin.svg @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/images/qr-icons/list.svg b/public/images/qr-icons/list.svg new file mode 100644 index 0000000..ccf7f95 --- /dev/null +++ b/public/images/qr-icons/list.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/public/images/qr-icons/terms.svg b/public/images/qr-icons/terms.svg new file mode 100644 index 0000000..6b352e0 --- /dev/null +++ b/public/images/qr-icons/terms.svg @@ -0,0 +1,4 @@ + + + + diff --git a/public/images/qr-icons/tik-tok.svg b/public/images/qr-icons/tik-tok.svg new file mode 100644 index 0000000..7e6913c --- /dev/null +++ b/public/images/qr-icons/tik-tok.svg @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/public/images/qr-icons/twitter.svg b/public/images/qr-icons/twitter.svg new file mode 100644 index 0000000..2e05e5f --- /dev/null +++ b/public/images/qr-icons/twitter.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/public/images/qr-icons/website.svg b/public/images/qr-icons/website.svg new file mode 100644 index 0000000..e6b7459 --- /dev/null +++ b/public/images/qr-icons/website.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/public/images/qr-icons/whatsapp.svg b/public/images/qr-icons/whatsapp.svg new file mode 100644 index 0000000..17ee32c --- /dev/null +++ b/public/images/qr-icons/whatsapp.svg @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/public/images/qr-icons/wifi.svg b/public/images/qr-icons/wifi.svg new file mode 100644 index 0000000..d56723c --- /dev/null +++ b/public/images/qr-icons/wifi.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/public/images/qr-icons/youtube.svg b/public/images/qr-icons/youtube.svg new file mode 100644 index 0000000..cf2e8d9 --- /dev/null +++ b/public/images/qr-icons/youtube.svg @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/index.php b/public/index.php new file mode 100644 index 0000000..ee8f07e --- /dev/null +++ b/public/index.php @@ -0,0 +1,20 @@ +handleRequest(Request::capture()); diff --git a/public/robots.txt b/public/robots.txt new file mode 100644 index 0000000..eb05362 --- /dev/null +++ b/public/robots.txt @@ -0,0 +1,2 @@ +User-agent: * +Disallow: diff --git a/resources/css/app.css b/resources/css/app.css new file mode 100644 index 0000000..6834036 --- /dev/null +++ b/resources/css/app.css @@ -0,0 +1,166 @@ +@import 'tailwindcss'; +@plugin '@tailwindcss/forms'; + +@source '../../vendor/laravel/framework/src/Illuminate/Pagination/resources/views/*.blade.php'; +@source '../../storage/framework/views/*.php'; +@source '../**/*.blade.php'; +@source '../**/*.js'; + +@theme { + --font-sans: 'Figtree', ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', + 'Segoe UI Symbol', 'Noto Color Emoji'; +} + +[x-cloak] { + display: none !important; +} + +/* QR create/show: flush mobile action bar to the physical screen bottom (mobile only) */ +@media (max-width: 1023px) { + .mobile-action-bar { + position: fixed; + inset-inline: 0; + bottom: 0; + z-index: 50; + display: flex; + flex-direction: column; + background-color: #fff; + } + + .mobile-action-bar__toolbar { + display: flex; + height: 4rem; + flex-shrink: 0; + align-items: center; + gap: 0.75rem; + border-top: 1px solid rgb(226 232 240); + background-color: #fff; + padding-inline: 1rem; + } + + .mobile-action-bar__inset-fill { + flex-shrink: 0; + width: 100%; + background-color: #fff; + height: env(safe-area-inset-bottom, 0px); + min-height: max(env(safe-area-inset-bottom, 0px), 20px); + } +} + +/* Extra white bleed behind the bar for any remaining viewport gap on mobile */ +.qr-mobile-bottom-bleed { + position: fixed; + inset-inline: 0; + bottom: 0; + z-index: 48; + pointer-events: none; + background-color: #fff; + height: calc(4rem + env(safe-area-inset-bottom, 0px) + 24px); + min-height: calc(4rem + 24px); +} + +html.qr-mobile-page { + background-color: #fff; +} + +html.qr-mobile-page body { + background-color: #fff; +} + +/* Payment QR landing: lock scroll and keep the amount sheet flush to the screen bottom */ +@media (max-width: 767px) { + html.mini-payment-page, + html.mini-payment-page body { + overflow: hidden; + width: 100%; + height: 100%; + } + + html.mini-payment-page body { + position: fixed; + inset: 0; + } + + .mini-payment-sheet { + position: fixed; + inset-inline: 0; + bottom: 0; + z-index: 20; + } + + .mini-payment-bottom-bleed { + position: fixed; + inset-inline: 0; + bottom: 0; + z-index: 19; + pointer-events: none; + background-color: #fff; + height: calc(12rem + env(safe-area-inset-bottom, 0px)); + min-height: 8rem; + } +} + +.mobile-stats-card { + width: calc(66.666667% - 0.5rem); +} + +@layer components { + .btn-primary { + display: inline-flex; + align-items: center; + justify-content: center; + gap: 0.5rem; + border-radius: 9999px; + background-image: linear-gradient(to right, rgb(79 70 229), rgb(124 58 237)); + padding: 0.5rem 1rem; + font-size: 0.875rem; + line-height: 1.25rem; + font-weight: 600; + color: #fff; + box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05); + transition: filter 0.15s ease; + } + + .btn-primary:hover { + filter: brightness(0.92); + } + + .btn-primary:disabled { + opacity: 0.6; + pointer-events: none; + } + + .btn-primary-sm { + padding: 0.375rem 0.75rem; + font-size: 0.75rem; + line-height: 1rem; + } + + .btn-primary-lg { + padding: 0.625rem 1.25rem; + } + + .btn-fab { + display: inline-flex; + height: 2.75rem; + width: 2.75rem; + align-items: center; + justify-content: center; + border-radius: 9999px; + background-image: linear-gradient(to right, rgb(79 70 229), rgb(124 58 237)); + color: #fff; + box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1); + transition: filter 0.15s ease; + } + + .btn-fab:hover { + filter: brightness(0.92); + } +} + + +@media (min-width: 640px) { + .mobile-stats-card { + width: auto; + } +} diff --git a/resources/js/app.js b/resources/js/app.js new file mode 100644 index 0000000..1af3fdd --- /dev/null +++ b/resources/js/app.js @@ -0,0 +1,174 @@ +import Alpine from 'alpinejs'; +import collapse from '@alpinejs/collapse'; +import { registerKioskFlow } from './kiosk-flow'; + +Alpine.plugin(collapse); +document.addEventListener('alpine:init', () => registerKioskFlow(Alpine)); + +// In-app notification bell + dropdown. +Alpine.data('notificationDropdown', (config = {}) => ({ + open: false, + loading: false, + notifications: [], + unreadCount: 0, + unreadUrl: config.unreadUrl || '/notifications/unread', + markReadUrl: config.markReadUrl || '/notifications/__ID__/read', + markAllReadUrl: config.markAllReadUrl || '/notifications/mark-all-read', + indexUrl: config.indexUrl || '/notifications', + csrfToken: config.csrfToken || document.querySelector('meta[name="csrf-token"]')?.content || '', + + init() { + this.fetchUnread(); + setInterval(() => this.fetchUnread(), 60000); + }, + async fetchUnread() { + try { + const res = await fetch(this.unreadUrl, { + headers: { Accept: 'application/json', 'X-Requested-With': 'XMLHttpRequest' }, + }); + const data = await res.json(); + this.notifications = data.notifications || []; + this.unreadCount = data.unread_count || 0; + } catch (e) { + console.error('Failed to fetch notifications', e); + } + }, + toggle() { + this.open = !this.open; + if (this.open) { + this.loading = true; + this.fetchUnread().finally(() => { this.loading = false; }); + } + }, + async markRead(id) { + const url = this.markReadUrl.replace('__ID__', id); + try { + await fetch(url, { + method: 'POST', + headers: { Accept: 'application/json', 'Content-Type': 'application/json', 'X-CSRF-TOKEN': this.csrfToken, 'X-Requested-With': 'XMLHttpRequest' }, + }); + this.notifications = this.notifications.filter(n => n.id !== id); + this.unreadCount = Math.max(0, this.unreadCount - 1); + } catch (e) { + console.error('Failed to mark notification as read', e); + } + }, + async markAllRead() { + try { + await fetch(this.markAllReadUrl, { + method: 'POST', + headers: { Accept: 'application/json', 'Content-Type': 'application/json', 'X-CSRF-TOKEN': this.csrfToken, 'X-Requested-With': 'XMLHttpRequest' }, + }); + this.notifications = []; + this.unreadCount = 0; + } catch (e) { + console.error('Failed to mark all notifications as read', e); + } + }, + getIconBg(icon) { + const map = { success: 'bg-green-50', task: 'bg-amber-50' }; + return map[icon] || 'bg-slate-100'; + }, + getIconColor(icon) { + const map = { success: 'text-green-600', task: 'text-amber-600' }; + return map[icon] || 'text-slate-500'; + }, +})); + +// Afia — in-app AI assistant slide-over. Opened via $dispatch('afia-open'). +Alpine.data('afia', (config = {}) => ({ + open: false, + input: '', + loading: false, + messages: [ + { role: 'assistant', text: config.greeting || "Hi, I'm Afia 👋 How can I help?" }, + ], + suggestions: config.suggestions || [], + init() { + window.addEventListener('afia-open', () => { + this.open = true; + this.$nextTick(() => this.$refs.input && this.$refs.input.focus()); + }); + }, + close() { this.open = false; }, + useSuggestion(s) { this.input = s; this.send(); }, + scrollDown() { + this.$nextTick(() => { const el = this.$refs.scroll; if (el) el.scrollTop = el.scrollHeight; }); + }, + async send() { + const text = this.input.trim(); + if (!text || this.loading) return; + const history = this.messages.map((m) => ({ role: m.role, text: m.text })); + this.messages.push({ role: 'user', text }); + this.input = ''; + this.loading = true; + this.scrollDown(); + try { + const res = await fetch(config.chatUrl, { + method: 'POST', + headers: { 'Content-Type': 'application/json', 'X-CSRF-TOKEN': config.csrf, 'Accept': 'application/json' }, + body: JSON.stringify({ message: text, history }), + }); + const data = await res.json(); + if (! res.ok) { + this.messages.push({ role: 'assistant', text: data.message || data.reply || 'Sorry, I could not respond.' }); + } else { + this.messages.push({ role: 'assistant', text: data.reply || data.message || 'Sorry, I could not respond.' }); + } + } catch (e) { + this.messages.push({ role: 'assistant', text: 'Network error — please try again.' }); + } + this.loading = false; + this.scrollDown(); + }, +})); + +// Wallet balance peek for the avatar dropdown. +Alpine.data('walletWidget', (config = {}) => ({ + display: '…', + async load() { + try { + const res = await fetch(config.url, { headers: { Accept: 'application/json', 'X-Requested-With': 'XMLHttpRequest' } }); + const data = await res.json(); + this.display = data.available ? data.formatted : 'View wallet'; + } catch (e) { + this.display = 'View wallet'; + } + }, +})); + +// Deal line-items editor — products/services as quote lines; deal value = subtotal. +Alpine.data('dealForm', (initialLines = [], products = []) => ({ + lines: Array.isArray(initialLines) ? initialLines : [], + products: Array.isArray(products) ? products : [], + selectedProduct: '', + addLine() { + this.lines.push({ product_id: '', description: '', quantity: 1, unit_price: '' }); + }, + removeLine(index) { + this.lines.splice(index, 1); + }, + addProductLine() { + const p = this.products.find((x) => String(x.id) === String(this.selectedProduct)); + if (!p) return; + this.lines.push({ + product_id: p.id, + description: p.name || '', + quantity: 1, + unit_price: (Number(p.unit_price_minor || 0) / 100).toFixed(2), + }); + this.selectedProduct = ''; + }, + lineTotal(line) { + return (parseFloat(line.quantity) || 0) * (parseFloat(line.unit_price) || 0); + }, + get subtotal() { + return this.lines.reduce((sum, line) => sum + this.lineTotal(line), 0); + }, + money(value) { + return (Number(value) || 0).toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 }); + }, +})); + +window.Alpine = Alpine; +Alpine.start(); diff --git a/resources/views/auth/signed-out.blade.php b/resources/views/auth/signed-out.blade.php new file mode 100644 index 0000000..35a188e --- /dev/null +++ b/resources/views/auth/signed-out.blade.php @@ -0,0 +1,52 @@ +@php + $signedOut = (array) config('signed_out'); + $logo = (string) ($signedOut['logo'] ?? 'images/logo/ladillcare-logo.svg'); + $logoPath = public_path($logo); +@endphp + + + + + + Signed out — {{ $signedOut['title'] ?? config('app.name') }} + @include('partials.favicon') + + + @vite(['resources/css/app.css']) + + + +
+
+ +
+ {{ $signedOut['title'] ?? config('app.name') }} + +
+ +
+ +

You’re signed out

+

+ {{ $signedOut['description'] ?? ('Your '.($signedOut['title'] ?? config('app.name')).' session has ended. Sign in again to continue.') }} +

+ + + Sign in again + + + + Go to ladill.com + +
+
+ + diff --git a/resources/views/auth/sso-error.blade.php b/resources/views/auth/sso-error.blade.php new file mode 100644 index 0000000..9d89915 --- /dev/null +++ b/resources/views/auth/sso-error.blade.php @@ -0,0 +1,30 @@ +@php + $signedOut = (array) config('signed_out'); + $logo = (string) ($signedOut['logo'] ?? 'images/logo/ladillcare-logo.svg'); + $title = (string) ($signedOut['title'] ?? config('app.name')); + $logoPath = public_path($logo); +@endphp + + + + + + Sign-in problem · {{ $title }} + @include('partials.favicon') + @vite(['resources/css/app.css']) + + +
+ {{ $title }} +

We couldn't sign you in

+

+ Sign-in didn't complete after a few tries. This is usually a temporary + issue with the Ladill account service. Please wait a moment and try again. +

+ @if ($reason !== '') +

Reference: {{ $reason }}

+ @endif + Try again +
+ + diff --git a/resources/views/auth/sso-logout-bridge.blade.php b/resources/views/auth/sso-logout-bridge.blade.php new file mode 100644 index 0000000..2540367 --- /dev/null +++ b/resources/views/auth/sso-logout-bridge.blade.php @@ -0,0 +1,26 @@ + + + + + + Signing out… + @include('partials.favicon') + + + + +

Signing you out of Ladill…

+ + + + diff --git a/resources/views/care/admin/branches/create.blade.php b/resources/views/care/admin/branches/create.blade.php new file mode 100644 index 0000000..e57f99b --- /dev/null +++ b/resources/views/care/admin/branches/create.blade.php @@ -0,0 +1,13 @@ + +
+

Add branch

+
+ @csrf +
+
+
+
+ +
+
+
diff --git a/resources/views/care/admin/branches/edit.blade.php b/resources/views/care/admin/branches/edit.blade.php new file mode 100644 index 0000000..a348719 --- /dev/null +++ b/resources/views/care/admin/branches/edit.blade.php @@ -0,0 +1,14 @@ + +
+

Edit branch

+
+ @csrf @method('PUT') +
+
+
+
+ + +
+
+
diff --git a/resources/views/care/admin/branches/index.blade.php b/resources/views/care/admin/branches/index.blade.php new file mode 100644 index 0000000..d5edfb0 --- /dev/null +++ b/resources/views/care/admin/branches/index.blade.php @@ -0,0 +1,22 @@ + +
+

Branches

+ @if (app(\App\Services\Care\CarePermissions::class)->can(auth()->user() ? app(\App\Services\Care\OrganizationResolver::class)->memberFor(auth()->user(), $organization) : null, 'admin.branches.manage')) + Add branch + @endif +
+ +
+ @forelse ($branches as $branch) +
+
+

{{ $branch->name }}

+

{{ $branch->address ?? 'No address' }} · {{ $branch->departments_count }} department(s)

+
+ Edit +
+ @empty +

No branches yet.

+ @endforelse +
+
diff --git a/resources/views/care/admin/departments/create.blade.php b/resources/views/care/admin/departments/create.blade.php new file mode 100644 index 0000000..e7dc18d --- /dev/null +++ b/resources/views/care/admin/departments/create.blade.php @@ -0,0 +1,26 @@ + +
+

Add department

+
+ @csrf +
+ + +
+
+
+ + +
+ +
+
+
diff --git a/resources/views/care/admin/departments/edit.blade.php b/resources/views/care/admin/departments/edit.blade.php new file mode 100644 index 0000000..e45d49f --- /dev/null +++ b/resources/views/care/admin/departments/edit.blade.php @@ -0,0 +1,19 @@ + +
+

Edit department

+
+ @csrf @method('PUT') +
+
+ + +
+ + +
+
+
diff --git a/resources/views/care/admin/departments/index.blade.php b/resources/views/care/admin/departments/index.blade.php new file mode 100644 index 0000000..97d7464 --- /dev/null +++ b/resources/views/care/admin/departments/index.blade.php @@ -0,0 +1,28 @@ + +
+

Departments

+ Add department +
+ +
+ + + + + + @forelse ($departments as $department) + + + + + + + @empty + + @endforelse + +
NameTypeBranch
{{ $department->name }}{{ $types[$department->type] ?? $department->type }}{{ $department->branch?->name }} + Edit +
No departments yet.
+
+
diff --git a/resources/views/care/admin/members/create.blade.php b/resources/views/care/admin/members/create.blade.php new file mode 100644 index 0000000..76de996 --- /dev/null +++ b/resources/views/care/admin/members/create.blade.php @@ -0,0 +1,28 @@ + +
+

Add team member

+

Enter the Ladill user public ID (UUID) from their account profile.

+
+ @csrf +
+
+ + +
+
+ + +
+ +
+
+
diff --git a/resources/views/care/admin/members/index.blade.php b/resources/views/care/admin/members/index.blade.php new file mode 100644 index 0000000..220374b --- /dev/null +++ b/resources/views/care/admin/members/index.blade.php @@ -0,0 +1,31 @@ + +
+

Team members

+ Add member +
+ +
+ + + + + + @foreach ($members as $member) + + + + + + + @endforeach + +
User IDRoleBranch
{{ $member->user_ref }}{{ $roles[$member->role] ?? $member->role }}{{ $member->branch?->name ?? 'All branches' }} + @if ($member->user_ref !== auth()->user()->public_id) +
+ @csrf @method('DELETE') + +
+ @endif +
+
+
diff --git a/resources/views/care/appointments/_form.blade.php b/resources/views/care/appointments/_form.blade.php new file mode 100644 index 0000000..30766b3 --- /dev/null +++ b/resources/views/care/appointments/_form.blade.php @@ -0,0 +1,56 @@ +@php + $isWalkIn = $isWalkIn ?? false; +@endphp + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+ @unless ($isWalkIn) +
+ + +
+ @endunless +
+ + +
+
+ + +
+
diff --git a/resources/views/care/appointments/create.blade.php b/resources/views/care/appointments/create.blade.php new file mode 100644 index 0000000..c6e1d24 --- /dev/null +++ b/resources/views/care/appointments/create.blade.php @@ -0,0 +1,13 @@ + +

Book appointment

+

Schedule a future visit for a patient

+ +
+ @csrf + @include('care.appointments._form') +
+ + Cancel +
+
+
diff --git a/resources/views/care/appointments/index.blade.php b/resources/views/care/appointments/index.blade.php new file mode 100644 index 0000000..0d05190 --- /dev/null +++ b/resources/views/care/appointments/index.blade.php @@ -0,0 +1,76 @@ + +
+
+

Appointments

+

Schedule and manage patient appointments

+
+ @if (app(\App\Services\Care\CarePermissions::class)->can(auth()->user() ? app(\App\Services\Care\OrganizationResolver::class)->memberFor(auth()->user(), $organization) : null, 'appointments.manage')) + + @endif +
+ +
+ + + + + @if (request()->hasAny(['date', 'status', 'practitioner_id'])) + Clear + @endif +
+ +
+ + + + + + + + + + + + + @forelse ($appointments as $appointment) + + + + + + + + + @empty + + + + @endforelse + +
PatientScheduledPractitionerTypeStatus
+

{{ $appointment->patient->fullName() }}

+

{{ $appointment->patient->patient_number }}

+
{{ $appointment->scheduled_at?->format('d M Y H:i') ?? '—' }}{{ $appointment->practitioner?->name ?? '—' }}{{ str_replace('_', ' ', $appointment->type) }} + + {{ $statuses[$appointment->status] ?? $appointment->status }} + + + View +
No appointments found.
+
+ +
{{ $appointments->links() }}
+
diff --git a/resources/views/care/appointments/show.blade.php b/resources/views/care/appointments/show.blade.php new file mode 100644 index 0000000..1a6bc41 --- /dev/null +++ b/resources/views/care/appointments/show.blade.php @@ -0,0 +1,66 @@ + +
+
+

{{ $statuses[$appointment->status] ?? $appointment->status }}

+

{{ $appointment->patient->fullName() }}

+

+ {{ $appointment->scheduled_at?->format('d M Y H:i') ?? 'Walk-in' }} + @if ($appointment->practitioner) · {{ $appointment->practitioner->name }} @endif +

+
+
+ @if ($canManage && $appointment->status === \App\Models\Appointment::STATUS_SCHEDULED) +
+ @csrf + +
+
+ @csrf + +
+ @endif + @if ($canConsult && in_array($appointment->status, [\App\Models\Appointment::STATUS_WAITING, \App\Models\Appointment::STATUS_CHECKED_IN], true)) +
+ @csrf + +
+ @endif + @if ($appointment->consultation) + View consultation + @endif + @if ($canManage && ! in_array($appointment->status, [\App\Models\Appointment::STATUS_COMPLETED, \App\Models\Appointment::STATUS_CANCELLED], true)) +
+ @csrf + +
+ @endif +
+
+ +
+
+

Details

+
+ +
Branch
{{ $appointment->branch?->name ?? '—' }}
+
Department
{{ $appointment->department?->name ?? '—' }}
+
Type
{{ str_replace('_', ' ', $appointment->type) }}
+
Reason
{{ $appointment->reason ?? '—' }}
+ @if ($appointment->notes) +
Notes
{{ $appointment->notes }}
+ @endif +
+
+ +
+

Timeline

+
+
Checked in
{{ $appointment->checked_in_at?->format('d M Y H:i') ?? '—' }}
+
Waiting since
{{ $appointment->waiting_at?->format('d M Y H:i') ?? '—' }}
+
Queue position
{{ $appointment->queue_position ?? '—' }}
+
Started
{{ $appointment->started_at?->format('d M Y H:i') ?? '—' }}
+
Completed
{{ $appointment->completed_at?->format('d M Y H:i') ?? '—' }}
+
+
+
+
diff --git a/resources/views/care/appointments/walk-in.blade.php b/resources/views/care/appointments/walk-in.blade.php new file mode 100644 index 0000000..6b1c8d8 --- /dev/null +++ b/resources/views/care/appointments/walk-in.blade.php @@ -0,0 +1,13 @@ + +

Register walk-in

+

Check in a patient and add them to the queue immediately

+ +
+ @csrf + @include('care.appointments._form', ['isWalkIn' => true]) +
+ + Cancel +
+
+
diff --git a/resources/views/care/audit/index.blade.php b/resources/views/care/audit/index.blade.php new file mode 100644 index 0000000..51969df --- /dev/null +++ b/resources/views/care/audit/index.blade.php @@ -0,0 +1,41 @@ + +
+

Audit log

+ @if ($canExport) + Export CSV + @endif +
+ +
+ + + +
+ +
+ + + + + + @forelse ($logs as $log) + + + + + + + @empty + + @endforelse + +
TimeActionActorSubject
{{ $log->created_at?->format('Y-m-d H:i') }}{{ $actions[$log->action] ?? $log->action }}{{ $log->actor_ref ?? '—' }}{{ $log->subject_type ? class_basename($log->subject_type).' #'.$log->subject_id : '—' }}
No audit entries yet.
+
+ +
{{ $logs->links() }}
+
diff --git a/resources/views/care/bills/index.blade.php b/resources/views/care/bills/index.blade.php new file mode 100644 index 0000000..1155f4e --- /dev/null +++ b/resources/views/care/bills/index.blade.php @@ -0,0 +1,40 @@ +@php $money = fn ($minor) => config('care.billing.currency').' '.number_format($minor / 100, 2); @endphp + +
+
+

Bills & invoices

+

Encounter billing and outstanding balances

+
+
+
+ + +
+
+ + + + + + @forelse ($bills as $bill) + + + + + + + + + @empty + + @endforelse + +
InvoicePatientTotalBalanceStatus
{{ $bill->invoice_number }}{{ $bill->patient->fullName() }}{{ $money($bill->total_minor) }}{{ $money($bill->balance_minor) }}{{ $statuses[$bill->status] ?? $bill->status }}View
No bills yet.
+
+
{{ $bills->links() }}
+
diff --git a/resources/views/care/bills/print.blade.php b/resources/views/care/bills/print.blade.php new file mode 100644 index 0000000..dfd9bb6 --- /dev/null +++ b/resources/views/care/bills/print.blade.php @@ -0,0 +1,25 @@ +@php $money = fn ($minor) => config('care.billing.currency').' '.number_format($minor / 100, 2); @endphp + + + + + {{ $bill->invoice_number }} + + + +
+

{{ $organization->name }}

+

Invoice {{ $bill->invoice_number }} · {{ $bill->created_at->format('d M Y') }}

+

{{ $bill->patient->fullName() }} ({{ $bill->patient->patient_number }})

+
+ + + + @foreach ($bill->lineItems as $item) + + @endforeach + +
DescriptionQtyAmount
{{ $item->description }}{{ $item->quantity }}{{ $money($item->total_minor) }}
+

Total: {{ $money($bill->total_minor) }} · Paid: {{ $money($bill->amount_paid_minor) }} · Balance: {{ $money($bill->balance_minor) }}

+ + diff --git a/resources/views/care/bills/show.blade.php b/resources/views/care/bills/show.blade.php new file mode 100644 index 0000000..ca5f4f3 --- /dev/null +++ b/resources/views/care/bills/show.blade.php @@ -0,0 +1,91 @@ +@php $money = fn ($minor) => config('care.billing.currency').' '.number_format($minor / 100, 2); @endphp + +
+
+

{{ $statuses[$bill->status] ?? $bill->status }}

+

{{ $bill->invoice_number }}

+

{{ $bill->patient->fullName() }} · {{ $bill->branch?->name }}

+
+
+ Print + @if ($canManage && ! in_array($bill->status, [\App\Models\Bill::STATUS_PAID, \App\Models\Bill::STATUS_VOID])) +
@csrf
+ @endif +
+
+ +
+
+

Line items

+ + + + @foreach ($bill->lineItems as $item) + + + + + + + @endforeach + +
DescriptionQtyUnitTotal
{{ $item->description }} ({{ $lineTypes[$item->type] ?? $item->type }}){{ $item->quantity }}{{ $money($item->unit_price_minor) }}{{ $money($item->total_minor) }}
+
+
Subtotal
{{ $money($bill->subtotal_minor) }}
+ @if ($bill->discount_minor)
Discount
-{{ $money($bill->discount_minor) }}
@endif + @if ($bill->tax_minor)
Tax
{{ $money($bill->tax_minor) }}
@endif +
Total
{{ $money($bill->total_minor) }}
+
Balance
{{ $money($bill->balance_minor) }}
+
+
+ +
+ @if ($canManage && ! in_array($bill->status, [\App\Models\Bill::STATUS_PAID, \App\Models\Bill::STATUS_VOID])) +
+

Add line item

+
+ @csrf + + +
+ + +
+ +
+
+
+

Discount & tax

+
+ @csrf + + + +
+
+ @endif + + @if ($canPay && $bill->balance_minor > 0 && $bill->status !== \App\Models\Bill::STATUS_VOID) +
+

Record payment

+
+ @csrf + + + + +
+
+ @endif + +
+

Payments

+ @forelse ($bill->payments as $payment) +

{{ $money($payment->amount_minor) }} · {{ $paymentMethods[$payment->method] ?? $payment->method }} · {{ $payment->paid_at->format('d M Y') }}

+ @empty +

No payments recorded.

+ @endforelse +
+
+
+
diff --git a/resources/views/care/consultations/show.blade.php b/resources/views/care/consultations/show.blade.php new file mode 100644 index 0000000..04546ee --- /dev/null +++ b/resources/views/care/consultations/show.blade.php @@ -0,0 +1,232 @@ + +
+
+

+ {{ $isCompleted ? 'Completed' : 'In progress' }} +

+

{{ $consultation->patient->fullName() }}

+

+ {{ $consultation->patient->patient_number }} + @if ($consultation->practitioner) · {{ $consultation->practitioner->name }} @endif +

+
+ @if ($canManage && ! $isCompleted) +
+ @csrf + +
+ @endif + @if ($canPrescribe) + Prescribe + @endif + @if ($canGenerateBill && $isCompleted && $consultation->visit) +
+ @csrf + +
+ @endif +
+ + @if ($canRequestInvestigations && $investigationTypes->isNotEmpty()) +
+

Request investigations

+
+ @csrf +
+ @foreach ($investigationTypes as $type) + + @endforeach +
+
+ + +
+ +
+ @if ($consultation->investigationRequests->isNotEmpty()) +
+

Requested tests

+ @foreach ($consultation->investigationRequests as $req) +

+ {{ $req->investigationType->name }} + · {{ config('care.investigation_statuses')[$req->status] ?? $req->status }} +

+ @endforeach +
+ @endif +
+ @endif + + @if ($consultation->prescriptions->isNotEmpty()) +
+

Prescriptions

+
    + @foreach ($consultation->prescriptions as $rx) +
  • + + {{ $rx->created_at->format('d M Y H:i') }} + + · {{ config('care.prescription_statuses')[$rx->status] ?? $rx->status }} + · {{ $rx->items->pluck('name')->join(', ') }} +
  • + @endforeach +
+
+ @endif + + @if (! $isCompleted && ($canManage || $canVitals)) +
+ @csrf @method('PUT') + + @if ($canVitals) +
+

Vital signs

+ @php $latestVitals = $consultation->vitalSigns->last(); @endphp +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+ @endif + + @if ($canManage) +
+

Clinical notes

+
+
+ + +
+
+ + +
+
+ + +
+
+
+ +
+
+

Diagnoses

+ +
+ +
+ +
+

Documents

+ +
+ @endif + +
+ + Back to queue +
+
+ @else +
+ @if ($consultation->vitalSigns->isNotEmpty()) +
+

Vital signs

+ @foreach ($consultation->vitalSigns as $vitals) +
+
BP
{{ $vitals->bp_systolic }}/{{ $vitals->bp_diastolic }}
+
Pulse
{{ $vitals->pulse ?? '—' }}
+
Temp
{{ $vitals->temperature ?? '—' }}°C
+
SpO₂
{{ $vitals->spo2 ? $vitals->spo2.'%' : '—' }}
+
+ @endforeach +
+ @endif + + @if ($consultation->symptoms || $consultation->clinical_notes) +
+

Clinical notes

+ @if ($consultation->symptoms) +

Symptoms: {{ $consultation->symptoms }}

+ @endif + @if ($consultation->clinical_notes) +

{{ $consultation->clinical_notes }}

+ @endif +
+ @endif + + @if ($consultation->diagnoses->isNotEmpty()) +
+

Diagnoses

+
    + @foreach ($consultation->diagnoses as $diagnosis) +
  • + {{ $diagnosis->description }} + @if ($diagnosis->code) ({{ $diagnosis->code }}) @endif + @if ($diagnosis->is_primary) primary @endif +
  • + @endforeach +
+
+ @endif +
+ @endif +
diff --git a/resources/views/care/dashboard.blade.php b/resources/views/care/dashboard.blade.php new file mode 100644 index 0000000..95382db --- /dev/null +++ b/resources/views/care/dashboard.blade.php @@ -0,0 +1,63 @@ + +
+

{{ $organization->name }}

+

Healthcare management dashboard

+
+ +
+
+

Patients today

+

{{ $operational['patients_today'] }}

+
+
+

Appointments today

+

{{ $operational['appointments_today'] }}

+
+
+

Open bills

+

{{ $operational['open_bills'] }}

+
+
+

Revenue today

+

{{ config('care.billing.currency') }} {{ number_format($operational['revenue_today_minor'] / 100, 2) }}

+
+
+

Pending lab

+

{{ $operational['pending_lab'] }}

+
+
+ +
+
+

Active branches

+

{{ $stats['branches'] }}

+
+
+

Team members

+

{{ $stats['team_members'] }}

+
+
+

Departments

+

{{ $stats['departments'] }}

+
+
+ +
+

Branches

+
+ @forelse ($branches as $branch) +
+
+

{{ $branch->name }}

+

{{ $branch->departments_count }} department(s) · {{ $branch->address ?? 'No address' }}

+
+ @unless ($branch->is_active) + Inactive + @endunless +
+ @empty +

No branches configured yet.

+ @endforelse +
+
+
diff --git a/resources/views/care/lab/catalog/_form.blade.php b/resources/views/care/lab/catalog/_form.blade.php new file mode 100644 index 0000000..48af33f --- /dev/null +++ b/resources/views/care/lab/catalog/_form.blade.php @@ -0,0 +1,48 @@ +@php $inputName = fn ($field) => $type ? "old_{$field}" : $field; @endphp +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ +
+
+ + +
+
diff --git a/resources/views/care/lab/catalog/create.blade.php b/resources/views/care/lab/catalog/create.blade.php new file mode 100644 index 0000000..81d9521 --- /dev/null +++ b/resources/views/care/lab/catalog/create.blade.php @@ -0,0 +1,8 @@ + +

Add investigation type

+
+ @csrf + @include('care.lab.catalog._form', ['type' => null]) +
+
+
diff --git a/resources/views/care/lab/catalog/edit.blade.php b/resources/views/care/lab/catalog/edit.blade.php new file mode 100644 index 0000000..38db7f1 --- /dev/null +++ b/resources/views/care/lab/catalog/edit.blade.php @@ -0,0 +1,8 @@ + +

Edit {{ $type->name }}

+
+ @csrf @method('PUT') + @include('care.lab.catalog._form') +
+
+
diff --git a/resources/views/care/lab/catalog/index.blade.php b/resources/views/care/lab/catalog/index.blade.php new file mode 100644 index 0000000..e081b8f --- /dev/null +++ b/resources/views/care/lab/catalog/index.blade.php @@ -0,0 +1,27 @@ + +
+

Investigation catalog

+ Add test +
+
+ + + + + + @forelse ($types as $type) + + + + + + + + @empty + + @endforelse + +
NameCategoryReferencePrice
{{ $type->name }}{{ $categories[$type->category] ?? $type->category }}{{ $type->reference_text ?? ($type->reference_low.'–'.$type->reference_high) }} {{ $type->unit }}{{ number_format($type->price_minor / 100, 2) }}Edit
No tests in catalog.
+
+
{{ $types->links() }}
+
diff --git a/resources/views/care/lab/queue/index.blade.php b/resources/views/care/lab/queue/index.blade.php new file mode 100644 index 0000000..9184dd8 --- /dev/null +++ b/resources/views/care/lab/queue/index.blade.php @@ -0,0 +1,45 @@ + +
+
+

Lab work queue

+

Pending samples and investigations in progress

+
+
+ All requests + @if (app(\App\Services\Care\CarePermissions::class)->can(auth()->user() ? app(\App\Services\Care\OrganizationResolver::class)->memberFor(auth()->user(), $organization) : null, 'lab.manage')) + Catalog + @endif +
+
+ +
+ + + +
+ +
+ @forelse ($queue as $item) +
+
+

{{ $item->patient->fullName() }} — {{ $item->investigationType->name }}

+

{{ $statuses[$item->status] ?? $item->status }} · {{ $item->priority }} · {{ $item->created_at->diffForHumans() }}

+
+ Open +
+ @empty +

Queue is empty.

+ @endforelse +
+
diff --git a/resources/views/care/lab/requests/index.blade.php b/resources/views/care/lab/requests/index.blade.php new file mode 100644 index 0000000..806b65c --- /dev/null +++ b/resources/views/care/lab/requests/index.blade.php @@ -0,0 +1,47 @@ + +
+
+

Investigation requests

+

All laboratory and diagnostic requests

+
+ Lab queue +
+ +
+ + +
+ +
+ + + + + + + + + + + + @forelse ($requests as $item) + + + + + + + + @empty + + @endforelse + +
PatientTestStatusRequested
{{ $item->patient->fullName() }}{{ $item->investigationType->name }}{{ $statuses[$item->status] ?? $item->status }}{{ $item->created_at->format('d M Y') }}View
No requests found.
+
+
{{ $requests->links() }}
+
diff --git a/resources/views/care/lab/requests/show.blade.php b/resources/views/care/lab/requests/show.blade.php new file mode 100644 index 0000000..17160e3 --- /dev/null +++ b/resources/views/care/lab/requests/show.blade.php @@ -0,0 +1,72 @@ + +
+
+

{{ $statuses[$investigation->status] ?? $investigation->status }}

+

{{ $investigation->investigationType->name }}

+

{{ $investigation->patient->fullName() }} · {{ $investigation->patient->patient_number }}

+
+
+ @if ($canManage && $investigation->status === \App\Models\InvestigationRequest::STATUS_PENDING) +
@csrf
+ @endif + @if ($canManage && $investigation->status === \App\Models\InvestigationRequest::STATUS_SAMPLE_COLLECTED) +
@csrf
+ @endif + @if ($canManage && $investigation->status === \App\Models\InvestigationRequest::STATUS_AWAITING_REVIEW) +
@csrf
+ @endif + @if ($canManage && $investigation->status === \App\Models\InvestigationRequest::STATUS_COMPLETED) +
@csrf
+ @endif +
+
+ +
+
+

Request details

+
+
Priority
{{ $investigation->priority }}
+
Sample barcode
{{ $investigation->sample_barcode ?? '—' }}
+
Clinical notes
{{ $investigation->clinical_notes ?? '—' }}
+
+
+ + @if ($canManage && in_array($investigation->status, [\App\Models\InvestigationRequest::STATUS_IN_PROGRESS, \App\Models\InvestigationRequest::STATUS_AWAITING_REVIEW], true)) +
+

Enter results

+
+ @csrf +
+ + +

Ref: {{ $investigation->investigationType->reference_text ?? ($investigation->investigationType->reference_low.'–'.$investigation->investigationType->reference_high) }} {{ $investigation->investigationType->unit }}

+
+
+ + +
+
+ + +
+ + +
+
+ @endif + + @if ($investigation->result && ($canViewResults || $canManage)) +
+

Results @if ($investigation->result->is_abnormal)· Abnormal@endif

+ @foreach ($investigation->result->values as $val) +

+ {{ $val->parameter }}: {{ $val->value }} {{ $val->unit }} + @if ($val->reference_text || $val->reference_low) (ref: {{ $val->reference_text ?? $val->reference_low.'–'.$val->reference_high }}) @endif +

+ @endforeach + @if ($investigation->result->result_summary)

{{ $investigation->result->result_summary }}

@endif + @if ($investigation->result->interpretation)

{{ $investigation->result->interpretation }}

@endif +
+ @endif +
+
diff --git a/resources/views/care/onboarding/show.blade.php b/resources/views/care/onboarding/show.blade.php new file mode 100644 index 0000000..7fb1ca9 --- /dev/null +++ b/resources/views/care/onboarding/show.blade.php @@ -0,0 +1,62 @@ + +
+

Welcome to Ladill Care

+

Set up your healthcare facility to get started.

+ +
+ @csrf + +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ + +
+
+
diff --git a/resources/views/care/patients/_form.blade.php b/resources/views/care/patients/_form.blade.php new file mode 100644 index 0000000..b07abd5 --- /dev/null +++ b/resources/views/care/patients/_form.blade.php @@ -0,0 +1,146 @@ +@php + $patient = $patient ?? null; +@endphp + +
+
+

Demographics

+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+ +
+

Allergies

+
+ @for ($i = 0; $i < 3; $i++) + @php $allergy = old("allergies.{$i}", $patient?->allergies[$i] ?? null); @endphp +
+ + + +
+ @endfor +
+
+ +
+

Chronic conditions

+
+ @for ($i = 0; $i < 3; $i++) + @php $condition = old("conditions.{$i}", $patient?->conditions[$i] ?? null); @endphp +
+ + + +
+ @endfor +
+
+ +
+

Family history

+
+ @for ($i = 0; $i < 2; $i++) + @php $family = old("family_history.{$i}", $patient?->familyHistory[$i] ?? null); @endphp +
+ + +
+ @endfor +
+
+ +
+

Emergency contact

+ @php $contact = old('emergency_contacts.0', $patient?->emergencyContacts->first()); @endphp +
+ + + + +
+
+ +
+

Insurance

+ @php $insurance = old('insurance.0', $patient?->insurancePolicies->first()); @endphp +
+ + + + +
+
+ +
+

Documents

+ +

PDF or images, up to 10 MB each.

+
+
diff --git a/resources/views/care/patients/create.blade.php b/resources/views/care/patients/create.blade.php new file mode 100644 index 0000000..192ec8d --- /dev/null +++ b/resources/views/care/patients/create.blade.php @@ -0,0 +1,10 @@ + +
+

Register patient

+
+ @csrf + @include('care.patients._form') + +
+
+
diff --git a/resources/views/care/patients/edit.blade.php b/resources/views/care/patients/edit.blade.php new file mode 100644 index 0000000..e4e9cfe --- /dev/null +++ b/resources/views/care/patients/edit.blade.php @@ -0,0 +1,11 @@ + +
+

Edit patient

+

{{ $patient->patient_number }}

+
+ @csrf @method('PUT') + @include('care.patients._form', ['patient' => $patient]) + +
+
+
diff --git a/resources/views/care/patients/index.blade.php b/resources/views/care/patients/index.blade.php new file mode 100644 index 0000000..02f94dd --- /dev/null +++ b/resources/views/care/patients/index.blade.php @@ -0,0 +1,62 @@ + +
+
+

Patients

+

Search and manage patient records

+
+ @if (app(\App\Services\Care\CarePermissions::class)->can(auth()->user() ? app(\App\Services\Care\OrganizationResolver::class)->memberFor(auth()->user(), $organization) : null, 'patients.manage')) + Register patient + @endif +
+ +
+ + + + @if (request()->hasAny(['q', 'date_of_birth', 'phone', 'national_id', 'patient_number'])) + Clear + @endif +
+ +
+ + + + + + + + + + + + + @forelse ($patients as $patient) + + + + + + + + + @empty + + + + @endforelse + +
PatientPatient IDPhoneDOBBranch
+

{{ $patient->fullName() }}

+ @if ($patient->national_id) +

NID: {{ $patient->national_id }}

+ @endif +
{{ $patient->patient_number }}{{ $patient->phone ?? '—' }}{{ $patient->date_of_birth?->format('Y-m-d') ?? '—' }}{{ $patient->branch?->name ?? '—' }} + View +
No patients found.
+
+ +
{{ $patients->links() }}
+
diff --git a/resources/views/care/patients/show.blade.php b/resources/views/care/patients/show.blade.php new file mode 100644 index 0000000..db348ae --- /dev/null +++ b/resources/views/care/patients/show.blade.php @@ -0,0 +1,190 @@ + +
+
+

{{ $patient->patient_number }}

+

{{ $patient->fullName() }}

+

+ {{ $genders[$patient->gender] ?? '—' }} + @if ($patient->date_of_birth) + · {{ $patient->date_of_birth->format('d M Y') }} + ({{ $patient->date_of_birth->age }} yrs) + @endif + @if ($patient->phone) · {{ $patient->phone }} @endif +

+
+ @if ($canManage) +
+ Edit +
+ @csrf @method('DELETE') + +
+
+ @endif +
+ +
+
+
+

Personal information

+
+
National ID
{{ $patient->national_id ?? '—' }}
+
Email
{{ $patient->email ?? '—' }}
+
Address
{{ collect([$patient->address, $patient->city, $patient->region])->filter()->implode(', ') ?: '—' }}
+
Branch
{{ $patient->branch?->name ?? '—' }}
+
+ @if ($patient->notes) +

{{ $patient->notes }}

+ @endif +
+ +
+

Medical history

+
+
+

Allergies

+ @forelse ($patient->allergies as $allergy) +

{{ $allergy->allergen }} ({{ $allergySeverities[$allergy->severity] ?? $allergy->severity }})

+ @empty +

None recorded

+ @endforelse +
+
+

Conditions

+ @forelse ($patient->conditions as $condition) +

{{ $condition->condition }}@if ($condition->is_chronic) (chronic)@endif

+ @empty +

None recorded

+ @endforelse +
+
+

Family history

+ @forelse ($patient->familyHistory as $entry) +

{{ $entry->relation }}: {{ $entry->condition }}

+ @empty +

None recorded

+ @endforelse +
+
+
+ +
+

Visit & clinical history

+
+
+

Recent visits

+ @forelse ($visits as $visit) +

+ {{ $visit->checked_in_at?->format('d M Y H:i') ?? '—' }} + · {{ config('care.visit_statuses')[$visit->status] ?? $visit->status }} + @if ($visit->branch) · {{ $visit->branch->name }} @endif +

+ @empty +

No visits yet

+ @endforelse +
+
+

Consultations

+ @forelse ($consultations as $consultation) +

+ + {{ $consultation->started_at?->format('d M Y') ?? '—' }} + @if ($consultation->practitioner) · {{ $consultation->practitioner->name }} @endif + + @if ($consultation->diagnoses->isNotEmpty()) + — {{ $consultation->diagnoses->first()->description }} + @endif +

+ @empty +

No consultations yet

+ @endforelse +
+
+

Laboratory

+ @forelse ($laboratory as $lab) +

+ + {{ $lab->investigationType->name }} + + · {{ $lab->completed_at?->format('d M Y') ?? '—' }} + @if ($lab->result?->is_abnormal) + abnormal + @endif +

+ @empty +

No lab results yet

+ @endforelse +
+
+

Prescriptions

+ @forelse ($prescriptions as $rx) +

+ + {{ $rx->created_at->format('d M Y') }} + + · {{ config('care.prescription_statuses')[$rx->status] ?? $rx->status }} + · {{ $rx->items->pluck('name')->take(2)->join(', ') }} +

+ @empty +

No prescriptions yet

+ @endforelse +
+
+
+
+ +
+
+

Emergency contacts

+ @forelse ($patient->emergencyContacts as $contact) +
+

{{ $contact->name }}@if ($contact->is_primary) (primary)@endif

+

{{ $contact->phone }} · {{ $contact->relationship ?? '—' }}

+
+ @empty +

None recorded

+ @endforelse +
+ +
+

Insurance

+ @forelse ($patient->insurancePolicies as $policy) +
+

{{ $policy->provider_name }}

+

{{ $policy->policy_number ?? '—' }} · {{ $policy->coverage_type ?? '—' }}

+
+ @empty +

None recorded

+ @endforelse +
+ + @php $money = fn ($minor) => config('care.billing.currency').' '.number_format($minor / 100, 2); @endphp +
+

Billing

+
+ @forelse ($invoices as $invoice) +
+ {{ $invoice->invoice_number }} +

{{ $invoice->created_at->format('d M Y') }} · {{ $money($invoice->total_minor) }} · {{ config('care.bill_statuses')[$invoice->status] ?? $invoice->status }}

+
+ @empty +

No invoices yet

+ @endforelse +
+
+ +
+

Documents

+ +
+
+
+
diff --git a/resources/views/care/pharmacy/drugs/_form.blade.php b/resources/views/care/pharmacy/drugs/_form.blade.php new file mode 100644 index 0000000..cfa3257 --- /dev/null +++ b/resources/views/care/pharmacy/drugs/_form.blade.php @@ -0,0 +1,12 @@ +
+
+
+
+
+
+
+
+
+
+
+
diff --git a/resources/views/care/pharmacy/drugs/create.blade.php b/resources/views/care/pharmacy/drugs/create.blade.php new file mode 100644 index 0000000..9c4ef1b --- /dev/null +++ b/resources/views/care/pharmacy/drugs/create.blade.php @@ -0,0 +1,8 @@ + +

Add drug

+
+ @csrf + @include('care.pharmacy.drugs._form', ['drug' => null]) + +
+
diff --git a/resources/views/care/pharmacy/drugs/edit.blade.php b/resources/views/care/pharmacy/drugs/edit.blade.php new file mode 100644 index 0000000..9223d2c --- /dev/null +++ b/resources/views/care/pharmacy/drugs/edit.blade.php @@ -0,0 +1,8 @@ + +

Edit {{ $drug->name }}

+
+ @csrf @method('PUT') + @include('care.pharmacy.drugs._form') + +
+
diff --git a/resources/views/care/pharmacy/drugs/index.blade.php b/resources/views/care/pharmacy/drugs/index.blade.php new file mode 100644 index 0000000..444aed1 --- /dev/null +++ b/resources/views/care/pharmacy/drugs/index.blade.php @@ -0,0 +1,32 @@ +@php $money = fn ($minor) => config('care.billing.currency').' '.number_format($minor / 100, 2); @endphp + +
+

Drug inventory

+ @if ($canManage)Add drug@endif +
+ @if ($lowStock->isNotEmpty()) +
{{ $lowStock->count() }} drug(s) below reorder level.
+ @endif + @if ($expired->isNotEmpty()) +
{{ $expired->count() }} expired batch(es) with stock on hand.
+ @endif +
+
+ + + + @forelse ($drugs as $drug) + + + + + + + @empty + + @endforelse + +
DrugStockUnit price

{{ $drug->name }}

@if($drug->generic_name)

{{ $drug->generic_name }}

@endif
{{ $drug->stockOnHand() }} {{ $drug->unit }}{{ $money($drug->unit_price_minor) }}View
No drugs in inventory.
+
+
{{ $drugs->links() }}
+
diff --git a/resources/views/care/pharmacy/drugs/show.blade.php b/resources/views/care/pharmacy/drugs/show.blade.php new file mode 100644 index 0000000..c2c1059 --- /dev/null +++ b/resources/views/care/pharmacy/drugs/show.blade.php @@ -0,0 +1,36 @@ +@php $money = fn ($minor) => config('care.billing.currency').' '.number_format($minor / 100, 2); @endphp + +
+
+

{{ $drug->name }}

+

Stock: {{ $drug->stockOnHand() }} {{ $drug->unit }} · {{ $money($drug->unit_price_minor) }}

+
+ @if ($canManage)Edit@endif +
+ @if ($canManage) +
+

Receive stock

+
+ @csrf + + + + + +
+
+ @endif +
+

Batches

+
+ @forelse ($drug->batches as $batch) +
+ {{ $batch->batch_number }} · {{ $batch->quantity_on_hand }} on hand + {{ $batch->expiry_date?->format('Y-m-d') ?? 'No expiry' }} +
+ @empty +

No batches received.

+ @endforelse +
+
+
diff --git a/resources/views/care/prescriptions/create.blade.php b/resources/views/care/prescriptions/create.blade.php new file mode 100644 index 0000000..c093ec9 --- /dev/null +++ b/resources/views/care/prescriptions/create.blade.php @@ -0,0 +1,43 @@ + +

New prescription

+

{{ $consultation->patient->fullName() }} ({{ $consultation->patient->patient_number }})

+ +
+ @csrf +
+
+

Medications & procedures

+ +
+ +
+
+ + + +
+
+ + Cancel +
+
+
diff --git a/resources/views/care/prescriptions/index.blade.php b/resources/views/care/prescriptions/index.blade.php new file mode 100644 index 0000000..1fac9af --- /dev/null +++ b/resources/views/care/prescriptions/index.blade.php @@ -0,0 +1,30 @@ + +
+
+

Prescriptions

+

All prescriptions across the facility

+
+ Pharmacy queue +
+
+ + + + + + @forelse ($prescriptions as $rx) + + + + + + + + @empty + + @endforelse + +
PatientItemsStatusDate
{{ $rx->patient->fullName() }}{{ $rx->items->pluck('name')->join(', ') }}{{ $statuses[$rx->status] ?? $rx->status }}{{ $rx->created_at->format('d M Y') }}View
No prescriptions.
+
+
{{ $prescriptions->links() }}
+
diff --git a/resources/views/care/prescriptions/queue.blade.php b/resources/views/care/prescriptions/queue.blade.php new file mode 100644 index 0000000..6b6fd70 --- /dev/null +++ b/resources/views/care/prescriptions/queue.blade.php @@ -0,0 +1,59 @@ + +

Pharmacy queue

+

Active prescriptions awaiting dispensing

+
+ @forelse ($queue as $rx) +
+
+
+

{{ $rx->patient->fullName() }}

+

{{ $rx->patient->patient_number }} · {{ $rx->visit->branch?->name }}

+
    + @foreach ($rx->items as $item) +
  • {{ $item->is_procedure ? 'Procedure' : 'Med' }}: {{ $item->name }} {{ $item->dosage }} {{ $item->frequency }}
  • + @endforeach +
+ @if ($canDispense) +
+ @csrf + @php $allocIndex = 0; @endphp + @foreach ($rx->items as $item) + @if (! $item->is_procedure) +
+
+ + +
+ +
+ + +
+ @php $allocIndex++; @endphp +
+ @endif + @endforeach +
+ + View details +
+
+ @endif +
+ @unless ($canDispense) + View + @endunless +
+
+ @empty +

No prescriptions in queue.

+ @endforelse +
+
diff --git a/resources/views/care/prescriptions/show.blade.php b/resources/views/care/prescriptions/show.blade.php new file mode 100644 index 0000000..1b4c45d --- /dev/null +++ b/resources/views/care/prescriptions/show.blade.php @@ -0,0 +1,40 @@ + +
+
+

{{ $statuses[$prescription->status] ?? $prescription->status }}

+

{{ $prescription->patient->fullName() }}

+

{{ $prescription->created_at->format('d M Y H:i') }}

+
+
+ @if ($canManage && $prescription->status === \App\Models\Prescription::STATUS_DRAFT) +
@csrf
+ @endif + @if ($canDispense && $prescription->status === \App\Models\Prescription::STATUS_ACTIVE) +
@csrf
+ @endif + @if ($canManage && ! in_array($prescription->status, [\App\Models\Prescription::STATUS_DISPENSED, \App\Models\Prescription::STATUS_CANCELLED])) +
@csrf
+ @endif +
+
+ +
+

Items

+
+ @foreach ($prescription->items as $item) +
+

{{ $item->name }} @if ($item->is_procedure)(procedure)@endif

+

+ @if ($item->dosage) {{ $item->dosage }} @endif + @if ($item->frequency) · {{ $item->frequency }} @endif + @if ($item->duration) · {{ $item->duration }} @endif + @if ($item->route) · {{ $routes[$item->route] ?? $item->route }} @endif + @if ($item->quantity) · Qty: {{ $item->quantity }} @endif +

+ @if ($item->instructions)

{{ $item->instructions }}

@endif +
+ @endforeach +
+ @if ($prescription->notes)

{{ $prescription->notes }}

@endif +
+
diff --git a/resources/views/care/queue/index.blade.php b/resources/views/care/queue/index.blade.php new file mode 100644 index 0000000..762af99 --- /dev/null +++ b/resources/views/care/queue/index.blade.php @@ -0,0 +1,74 @@ + +
+
+

Patient queue

+

Waiting patients and active consultations

+
+ @if ($canManageQueue) + Walk-in + @endif +
+ +
+ + + +
+ +
+
+

Waiting ({{ $queue->count() }})

+
+ @forelse ($queue as $appointment) +
+
+

+ @if ($appointment->queue_position) + {{ $appointment->queue_position }} + @endif + {{ $appointment->patient->fullName() }} +

+

{{ $appointment->patient->patient_number }} · {{ $appointment->reason ?? '—' }}

+
+ @if ($canConsult) +
+ @csrf + +
+ @endif +
+ @empty +

No patients waiting.

+ @endforelse +
+
+ +
+

In consultation ({{ $inConsultation->count() }})

+
+ @forelse ($inConsultation as $appointment) +
+
+

{{ $appointment->patient->fullName() }}

+

{{ $appointment->practitioner?->name ?? 'Unassigned' }}

+
+ @if ($appointment->consultation) + Open + @endif +
+ @empty +

No active consultations.

+ @endforelse +
+
+
+
diff --git a/resources/views/care/reports/index.blade.php b/resources/views/care/reports/index.blade.php new file mode 100644 index 0000000..82ba56c --- /dev/null +++ b/resources/views/care/reports/index.blade.php @@ -0,0 +1,12 @@ + +

Reports

+

Operational and financial analytics

+
+ @foreach ($reports as $key => $label) + +

{{ $label }}

+

View and export

+
+ @endforeach +
+
diff --git a/resources/views/care/reports/show.blade.php b/resources/views/care/reports/show.blade.php new file mode 100644 index 0000000..801496d --- /dev/null +++ b/resources/views/care/reports/show.blade.php @@ -0,0 +1,52 @@ +@php + $money = fn ($minor) => config('care.billing.currency').' '.number_format($minor / 100, 2); + $formatValue = function ($key, $value) use ($money) { + if (str_ends_with($key, '_minor')) return $money((int) $value); + return $value; + }; +@endphp + +
+
+

{{ $label }}

+

{{ $from }} to {{ $to }}

+
+ @if ($canExport) + Export CSV + @endif +
+
+ + + + +
+
+ @if ($type === 'clinical' && isset($data['diagnoses'])) + + + + @forelse ($data['diagnoses'] as $row) + + @empty + + @endforelse + +
DiagnosisCount
{{ $row->description }}{{ $row->total }}
No diagnoses in period.
+ @else +
+ @foreach ($data as $key => $value) +
+
{{ str_replace('_', ' ', $key) }}
+
{{ $formatValue($key, $value) }}
+
+ @endforeach +
+ @endif +
+
diff --git a/resources/views/care/settings/edit.blade.php b/resources/views/care/settings/edit.blade.php new file mode 100644 index 0000000..4ef0ab8 --- /dev/null +++ b/resources/views/care/settings/edit.blade.php @@ -0,0 +1,45 @@ + +
+

Facility settings

+ +
+ @csrf @method('PUT') + +
+ + +
+ +
+ + +
+ +
+ + +
+ + @if ($canManage) +
+ + + @if (\App\Support\OrganizationBranding::hasCustomLogo($organization)) + + @endif +
+ + @endif +
+ +

{{ $branchCount }} branch(es) configured.

+
+
diff --git a/resources/views/components/app-layout.blade.php b/resources/views/components/app-layout.blade.php new file mode 100644 index 0000000..1560677 --- /dev/null +++ b/resources/views/components/app-layout.blade.php @@ -0,0 +1,60 @@ +@props(['title' => 'Ladill Care', 'heading' => null]) + + + + + + + {{ $title }} · Ladill Care + @include('partials.favicon') + + + @vite(['resources/css/app.css', 'resources/js/app.js']) + + + @include('partials.boot-splash') +
+
+ +
+ @include('partials.topbar', ['heading' => $heading ?? $title]) +
+ @include('partials.flash') + {{ $slot }} +
+
+
+ @auth + @php + $navUser = auth()->user(); + $navInitials = collect(explode(' ', trim((string) $navUser?->name))) + ->filter()->take(2) + ->map(fn ($part) => strtoupper(substr($part, 0, 1))) + ->implode(''); + $navAvatarUrl = $navUser && method_exists($navUser, 'avatarUrl') + ? $navUser->avatarUrl() + : ($navUser?->avatar_url ?? null); + @endphp + @include('partials.mobile-bottom-nav', [ + 'homeUrl' => route('care.dashboard'), + 'homeActive' => request()->routeIs('care.dashboard'), + 'searchUrl' => route('care.patients.index'), + 'searchActive' => request()->routeIs('care.patients.*'), + 'notificationsUrl' => route('care.dashboard'), + 'notificationsActive' => false, + 'unreadUrl' => route('care.dashboard'), + 'profileActive' => false, + 'profileName' => $navUser?->name ?? '', + 'profileSubtitle' => $navUser?->email ?? '', + 'profileMenuItems' => \App\Support\UserProfileMenu::items($navUser), + 'avatarUrl' => $navAvatarUrl, + 'initials' => $navInitials !== '' ? $navInitials : 'U', + ]) + @endauth + @include('partials.wallet-topup-modal', ['openOnLoad' => (bool) session('topup_required')]) + + diff --git a/resources/views/components/badge.blade.php b/resources/views/components/badge.blade.php new file mode 100644 index 0000000..a35a20f --- /dev/null +++ b/resources/views/components/badge.blade.php @@ -0,0 +1,15 @@ +@props(['color' => 'slate']) +@php + $map = [ + 'slate' => 'bg-slate-100 text-slate-700', + 'indigo' => 'bg-indigo-100 text-indigo-700', + 'green' => 'bg-green-100 text-green-700', + 'red' => 'bg-red-100 text-red-700', + 'amber' => 'bg-amber-100 text-amber-700', + 'blue' => 'bg-blue-100 text-blue-700', + ]; + $classes = $map[$color] ?? $map['slate']; +@endphp +merge(['class' => "inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium $classes"]) }}> + {{ $slot }} + diff --git a/resources/views/components/btn/create.blade.php b/resources/views/components/btn/create.blade.php new file mode 100644 index 0000000..f51caf4 --- /dev/null +++ b/resources/views/components/btn/create.blade.php @@ -0,0 +1,33 @@ +@props([ + 'href' => null, + 'type' => 'button', + 'label' => null, +]) + +@php + $tag = $href ? 'a' : 'button'; + $ariaLabel = $label ?? trim(preg_replace('/\s+/', ' ', strip_tags((string) $slot))); +@endphp + +<{{ $tag }} + @if ($href) href="{{ $href }}" @endif + @if ($tag === 'button') type="{{ $type }}" @endif + aria-label="{{ $ariaLabel }}" + title="{{ $ariaLabel }}" + {{ $attributes->class(['btn-fab h-10 w-10 lg:hidden']) }} +> + + + +<{{ $tag }} + @if ($href) href="{{ $href }}" @endif + @if ($tag === 'button') type="{{ $type }}" @endif + {{ $attributes->class(['btn-primary hidden lg:inline-flex']) }} +> + + {{ $slot }} + diff --git a/resources/views/components/field.blade.php b/resources/views/components/field.blade.php new file mode 100644 index 0000000..5b84fec --- /dev/null +++ b/resources/views/components/field.blade.php @@ -0,0 +1,37 @@ +@props([ + 'name', + 'label' => null, + 'type' => 'text', + 'value' => null, + 'options' => [], + 'placeholder' => '', + 'required' => false, + 'rows' => 4, +]) +@php + $label = $label ?? \Illuminate\Support\Str::headline($name); + $current = old($name, $value); + $base = 'mt-1 block w-full rounded-xl border-slate-300 text-sm shadow-sm focus:border-indigo-500 focus:ring-indigo-500'; +@endphp +
only('class') }}> + + + @if ($type === 'textarea') + + @elseif ($type === 'select') + + @else + + @endif + + @error($name)

{{ $message }}

@enderror +
diff --git a/resources/views/components/modal.blade.php b/resources/views/components/modal.blade.php new file mode 100644 index 0000000..a823707 --- /dev/null +++ b/resources/views/components/modal.blade.php @@ -0,0 +1,88 @@ +@props([ + 'name', + 'show' => false, + 'maxWidth' => '2xl' +]) + +@php +$maxWidth = [ + 'sm' => 'sm:max-w-sm', + 'md' => 'sm:max-w-md', + 'lg' => 'sm:max-w-lg', + 'xl' => 'sm:max-w-xl', + '2xl' => 'sm:max-w-2xl', +][$maxWidth]; +@endphp + +
+ {{-- Backdrop click to close --}} +
+ + {{-- Panel: bottom-sheet on mobile, centered card on sm+ --}} +
+ {{-- Drag handle (mobile only) --}} +
+
+
+ + {{-- Close button (desktop only) --}} + + + {{ $slot }} +
+
diff --git a/resources/views/email/contact-message.blade.php b/resources/views/email/contact-message.blade.php new file mode 100644 index 0000000..3cb5cc9 --- /dev/null +++ b/resources/views/email/contact-message.blade.php @@ -0,0 +1,18 @@ + + + + + + + +
+
+
{{ $bodyText }}
+ @if (! empty($fromName)) +

— {{ $fromName }}

+ @endif +
+

Sent via Ladill Frontdesk

+
+ + diff --git a/resources/views/notifications/index.blade.php b/resources/views/notifications/index.blade.php new file mode 100644 index 0000000..737a023 --- /dev/null +++ b/resources/views/notifications/index.blade.php @@ -0,0 +1,24 @@ + +
+

Notifications

+ + + +
{{ $notifications->links() }}
+
+
diff --git a/resources/views/partials/afia-button.blade.php b/resources/views/partials/afia-button.blade.php new file mode 100644 index 0000000..35c0366 --- /dev/null +++ b/resources/views/partials/afia-button.blade.php @@ -0,0 +1,15 @@ +@props(['compact' => false]) + + diff --git a/resources/views/partials/afia.blade.php b/resources/views/partials/afia.blade.php new file mode 100644 index 0000000..265fdb5 --- /dev/null +++ b/resources/views/partials/afia.blade.php @@ -0,0 +1,106 @@ +@php + $afiaGreeting = "Hi, I'm Afia 👋 Ask me about visitor check-in, kiosks, hosts, badges, devices, or setting up your reception desk…"; + $afiaSuggestions = [ + 'How do I set up a visitor kiosk?', + 'How do I check a visitor in?', + 'Where do I add reception desks?', + 'How do hosts approve visits?', + ]; +@endphp +{{-- Afia — Ladill AI assistant slide-over. Opened via $dispatch('afia-open'). --}} +
+
+ +
+
+
+ + + + +
+

Afia

+

Frontdesk assistant

+
+
+
+ History + +
+
+ +
+
+ +
+
+
+ + + +
+
+
+
+ +
+ +
+
+ +
+
+ + +
+

Afia can make mistakes — verify important details.

+
+
+
diff --git a/resources/views/partials/boot-splash.blade.php b/resources/views/partials/boot-splash.blade.php new file mode 100644 index 0000000..5d86769 --- /dev/null +++ b/resources/views/partials/boot-splash.blade.php @@ -0,0 +1,43 @@ +@php + // Branded boot splash (Ladill Mail style). Self-icon from this app's subdomain. + $sub = strtolower((string) ((explode('.', (string) (parse_url((string) config('app.url'), PHP_URL_HOST) ?: '')))[0] ?? '')); + $icon = $sub !== '' && is_file(public_path("images/launcher-icons/{$sub}.svg")) ? "images/launcher-icons/{$sub}.svg" : null; + $label = (string) config('app.name', 'Ladill'); +@endphp +
+
+ @if ($icon) + + @endif +
+
Loading {{ $label }}…
+
+
+ + diff --git a/resources/views/partials/favicon.blade.php b/resources/views/partials/favicon.blade.php new file mode 100644 index 0000000..8933ddf --- /dev/null +++ b/resources/views/partials/favicon.blade.php @@ -0,0 +1,8 @@ +@php + $svgVer = @filemtime(public_path('favicon.svg')) ?: '1'; + $icoVer = @filemtime(public_path('favicon.ico')) ?: '1'; +@endphp + + + + diff --git a/resources/views/partials/flash.blade.php b/resources/views/partials/flash.blade.php new file mode 100644 index 0000000..657ef02 --- /dev/null +++ b/resources/views/partials/flash.blade.php @@ -0,0 +1,34 @@ +@if (session('success')) +
+
+

{{ session('success') }}

+
+
+@endif + +@if (session('error')) +
+
+

{{ session('error') }}

+
+
+@endif + +@if (session('warning')) +
+
+

{{ session('warning') }}

+
+
+@endif + +@if ($errors->any()) +
+

Please fix the following:

+
    + @foreach ($errors->all() as $error) +
  • {{ $error }}
  • + @endforeach +
+
+@endif diff --git a/resources/views/partials/launcher.blade.php b/resources/views/partials/launcher.blade.php new file mode 100644 index 0000000..c26873d --- /dev/null +++ b/resources/views/partials/launcher.blade.php @@ -0,0 +1,53 @@ +@php + // Shared Ladill app launcher — IDENTICAL across every app/service. + // Driven by config/ladill_launcher.php (fully-extracted apps only) + icons + // from public/images/launcher-icons/. Omits the current app (matched by + // APP_URL host). To replicate elsewhere, copy this file + the config + + // the launcher-icons folder verbatim. + $sidebar = (bool) ($sidebar ?? false); + $selfHost = parse_url((string) config('app.url'), PHP_URL_HOST); + $launcherApps = array_values(array_filter( + config('ladill_launcher.apps', []), + fn (array $app) => parse_url($app['url'], PHP_URL_HOST) !== $selfHost + )); +@endphp +@if (! empty($launcherApps)) +
+ +
! $sidebar, + 'bottom-full left-0 mb-2' => $sidebar, + ])> +

All apps

+
+ @foreach ($launcherApps as $app) + + + + + {{ $app['name'] }} + + @endforeach +
+
+
+@endif diff --git a/resources/views/partials/mobile-bottom-nav.blade.php b/resources/views/partials/mobile-bottom-nav.blade.php new file mode 100644 index 0000000..5fbdf50 --- /dev/null +++ b/resources/views/partials/mobile-bottom-nav.blade.php @@ -0,0 +1,130 @@ +@php + $showSearch = isset($searchUrl) && $searchUrl !== null && $searchUrl !== '#'; + $gridCols = match (true) { + ! empty($centerCompose) => $showSearch ? 'grid-cols-5' : 'grid-cols-4', + default => $showSearch ? 'grid-cols-4' : 'grid-cols-3', + }; + $avatarUrl = $avatarUrl ?? null; + $initials = $initials ?? 'U'; + $notificationsUrl = $notificationsUrl ?? '#'; + $unreadUrl = $unreadUrl ?? null; + $profileUrl = $profileUrl ?? '#'; + $profileName = trim((string) ($profileName ?? '')); + $profileSubtitle = trim((string) ($profileSubtitle ?? '')); + $profileMenuItems = $profileMenuItems ?? []; + if ($profileMenuItems === [] && $profileUrl !== '#') { + $profileMenuItems = [['type' => 'link', 'label' => 'Profile', 'href' => $profileUrl]]; + } + $navActive = fn (bool $active) => $active ? 'text-indigo-600' : 'text-slate-600'; +@endphp +
+ + + {{-- Profile menu bottom sheet (matches desktop avatar dropdown) --}} +
+
+ +
+
+ +
+ + @if ($profileName !== '' || $profileSubtitle !== '') +
+ @if ($avatarUrl) + + @else + {{ $initials }} + @endif +
+ @if ($profileName !== '') +

{{ $profileName }}

+ @endif + @if ($profileSubtitle !== '') +

{{ $profileSubtitle }}

+ @endif +
+
+ @endif + + @include('partials.user-profile-menu', [ + 'items' => $profileMenuItems, + 'variant' => 'sheet', + 'onNavigate' => 'profileOpen = false', + ]) +
+
+
diff --git a/resources/views/partials/mobile-header-btn.blade.php b/resources/views/partials/mobile-header-btn.blade.php new file mode 100644 index 0000000..97d79c4 --- /dev/null +++ b/resources/views/partials/mobile-header-btn.blade.php @@ -0,0 +1,53 @@ +@php + $variant = $variant ?? 'primary'; + $type = $type ?? 'submit'; + $tag = ! empty($href) ? 'a' : 'button'; + $ariaLabel = $ariaLabel ?? $label ?? ''; + $desktopLabel = $desktopLabel ?? $label ?? ''; + $showDesktopIcon = $showDesktopIcon ?? ($variant === 'primary'); + + $mobileClass = match ($variant) { + 'primary' => 'btn-fab h-10 w-10 lg:hidden', + 'outline' => 'inline-flex h-10 w-10 items-center justify-center rounded-full border border-slate-200 bg-white text-slate-700 shadow-sm transition hover:border-slate-300 hover:bg-slate-50 lg:hidden', + 'dark' => 'inline-flex h-10 w-10 items-center justify-center rounded-full bg-gray-900 text-white shadow-sm transition hover:bg-gray-800 lg:hidden', + 'indigo' => 'inline-flex h-10 w-10 items-center justify-center rounded-full bg-indigo-600 text-white shadow-sm transition hover:bg-indigo-700 lg:hidden', + default => 'btn-fab h-10 w-10 lg:hidden', + }; + + $desktopClass = match ($variant) { + 'primary' => 'btn-primary hidden items-center lg:inline-flex', + 'outline' => 'hidden items-center rounded-lg border border-gray-200 bg-white px-4 py-2 text-sm font-medium text-gray-700 shadow-sm transition hover:bg-gray-50 lg:inline-flex', + 'dark' => 'hidden items-center gap-1.5 rounded-lg bg-gray-900 px-3.5 py-2 text-sm font-medium text-white transition hover:bg-gray-800 lg:inline-flex', + 'indigo' => 'hidden items-center justify-center rounded-xl bg-indigo-600 px-4 py-2.5 text-sm font-semibold text-white transition hover:bg-indigo-700 lg:inline-flex', + default => 'btn-primary hidden items-center lg:inline-flex', + }; + + $extraClass = $class ?? ''; +@endphp + +<{{ $tag }} + @if ($tag === 'a') href="{{ $href }}" @endif + @if ($tag === 'button') type="{{ $type }}" @endif + aria-label="{{ $ariaLabel }}" + title="{{ $ariaLabel }}" + @if (! empty($attributes)) {!! $attributes !!} @endif + class="{{ trim($mobileClass.' '.$extraClass) }}" +> + + + +<{{ $tag }} + @if ($tag === 'a') href="{{ $href }}" @endif + @if ($tag === 'button') type="{{ $type }}" @endif + @if (! empty($attributes)) {!! $attributes !!} @endif + class="{{ trim($desktopClass.' '.$extraClass) }}" +> + @if ($showDesktopIcon) + + @endif + {{ $desktopLabel }} + diff --git a/resources/views/partials/mobile-icon-link.blade.php b/resources/views/partials/mobile-icon-link.blade.php new file mode 100644 index 0000000..b1a96c4 --- /dev/null +++ b/resources/views/partials/mobile-icon-link.blade.php @@ -0,0 +1,27 @@ +@php + $icon = $icon ?? 'arrow'; + $desktopClass = $desktopClass ?? 'text-xs font-medium text-indigo-600 hover:text-indigo-700'; + $label = $label ?? ''; +@endphp + + + + @if ($icon === 'shield') + + @elseif ($icon === 'calendar') + + @else + + @endif + + + diff --git a/resources/views/partials/mobile-topbar-title.blade.php b/resources/views/partials/mobile-topbar-title.blade.php new file mode 100644 index 0000000..ff10b4a --- /dev/null +++ b/resources/views/partials/mobile-topbar-title.blade.php @@ -0,0 +1,6 @@ +@php + $title = $mobileTopbarTitle ?? 'Ladill'; +@endphp +
+

{{ $title }}

+
diff --git a/resources/views/partials/notification-dropdown.blade.php b/resources/views/partials/notification-dropdown.blade.php new file mode 100644 index 0000000..be1a23b --- /dev/null +++ b/resources/views/partials/notification-dropdown.blade.php @@ -0,0 +1,97 @@ +{{-- In-app notification bell + dropdown (scoped to this app). --}} + diff --git a/resources/views/partials/sidebar.blade.php b/resources/views/partials/sidebar.blade.php new file mode 100644 index 0000000..8ba7992 --- /dev/null +++ b/resources/views/partials/sidebar.blade.php @@ -0,0 +1,108 @@ +
+
+ + Ladill Care + +
+ @php + $member = auth()->user() + ? app(\App\Services\Care\OrganizationResolver::class)->memberFor(auth()->user()) + : null; + $permissions = app(\App\Services\Care\CarePermissions::class); + + $nav = [ + ['name' => 'Dashboard', 'route' => route('care.dashboard'), 'active' => request()->routeIs('care.dashboard'), + 'icon' => ''], + ]; + + if ($permissions->can($member, 'patients.view')) { + $nav[] = ['name' => 'Patients', 'route' => route('care.patients.index'), 'active' => request()->routeIs('care.patients.*'), + 'icon' => '']; + } + + if ($permissions->can($member, 'appointments.view')) { + $nav[] = ['name' => 'Appointments', 'route' => route('care.appointments.index'), 'active' => request()->routeIs('care.appointments.*'), + 'icon' => '']; + $nav[] = ['name' => 'Queue', 'route' => route('care.queue.index'), 'active' => request()->routeIs('care.queue.*') || request()->routeIs('care.consultations.*'), + 'icon' => '']; + } + + if ($permissions->can($member, 'lab.view')) { + $nav[] = ['name' => 'Laboratory', 'route' => route('care.lab.queue.index'), 'active' => request()->routeIs('care.lab.*'), + 'icon' => '']; + } + + if ($permissions->can($member, 'prescriptions.view')) { + $nav[] = ['name' => 'Pharmacy queue', 'route' => route('care.prescriptions.queue'), 'active' => request()->routeIs('care.prescriptions.*') && ! request()->routeIs('care.pharmacy.*'), + 'icon' => '']; + } + + if ($permissions->can($member, 'pharmacy.view')) { + $nav[] = ['name' => 'Inventory', 'route' => route('care.pharmacy.drugs.index'), 'active' => request()->routeIs('care.pharmacy.*'), + 'icon' => '']; + } + + if ($permissions->can($member, 'bills.view')) { + $nav[] = ['name' => 'Billing', 'route' => route('care.bills.index'), 'active' => request()->routeIs('care.bills.*'), + 'icon' => '']; + } + + if ($permissions->can($member, 'reports.finance.view')) { + $nav[] = ['name' => 'Reports', 'route' => route('care.reports.index'), 'active' => request()->routeIs('care.reports.*'), + 'icon' => '']; + } + + $adminNav = []; + if ($permissions->can($member, 'admin.branches.view')) { + $adminNav[] = ['name' => 'Branches', 'route' => route('care.branches.index'), 'active' => request()->routeIs('care.branches.*'), + 'icon' => '']; + } + if ($permissions->can($member, 'admin.departments.view')) { + $adminNav[] = ['name' => 'Departments', 'route' => route('care.departments.index'), 'active' => request()->routeIs('care.departments.*'), + 'icon' => '']; + } + if ($permissions->can($member, 'admin.members.view')) { + $adminNav[] = ['name' => 'Team', 'route' => route('care.members.index'), 'active' => request()->routeIs('care.members.*'), + 'icon' => '']; + } + if ($permissions->can($member, 'settings.view')) { + $adminNav[] = ['name' => 'Settings', 'route' => route('care.settings'), 'active' => request()->routeIs('care.settings*'), + 'icon' => '']; + } + if ($permissions->can($member, 'audit.view')) { + $adminNav[] = ['name' => 'Audit log', 'route' => route('care.audit.index'), 'active' => request()->routeIs('care.audit.*'), + 'icon' => '']; + } + @endphp + + + + +
diff --git a/resources/views/partials/topbar-account-switcher.blade.php b/resources/views/partials/topbar-account-switcher.blade.php new file mode 100644 index 0000000..dfcaf02 --- /dev/null +++ b/resources/views/partials/topbar-account-switcher.blade.php @@ -0,0 +1,24 @@ +{{-- Account switcher (desktop) — only when the user belongs to more than one account. --}} +@if (isset($accessibleAccounts) && $accessibleAccounts->count() > 1) + +@endif diff --git a/resources/views/partials/topbar-desktop-widgets.blade.php b/resources/views/partials/topbar-desktop-widgets.blade.php new file mode 100644 index 0000000..3be9422 --- /dev/null +++ b/resources/views/partials/topbar-desktop-widgets.blade.php @@ -0,0 +1,41 @@ +{{-- + Top-right header widgets: + Mobile — Afia + launcher only (profile/notifications live in bottom nav). + Desktop — Afia → notifications → launcher → divider → avatar dropdown. +--}} +@php + $topbarUser = $user ?? auth()->user(); + $initials = collect(explode(' ', trim((string) $topbarUser?->name))) + ->filter()->take(2)->map(fn ($p) => strtoupper(substr($p, 0, 1)))->implode(''); + $avatarUrl = $topbarUser && method_exists($topbarUser, 'avatarUrl') + ? $topbarUser->avatarUrl() + : ($topbarUser?->avatar_url ?? null); + $showUserHeader = $showUser ?? true; +@endphp + +@include('partials.launcher') + +@includeIf('partials.topbar-widgets-mid') + + + + diff --git a/resources/views/partials/topbar.blade.php b/resources/views/partials/topbar.blade.php new file mode 100644 index 0000000..7df329f --- /dev/null +++ b/resources/views/partials/topbar.blade.php @@ -0,0 +1,35 @@ +@php + $user = auth()->user(); + $initials = collect(explode(' ', trim((string) $user?->name))) + ->filter()->take(2)->map(fn ($p) => strtoupper(substr($p, 0, 1)))->implode(''); +@endphp +
+
+ + + @include('partials.mobile-topbar-title') + +

{{ $heading ?? 'Ladill Care' }}

+ + @if (auth()->check() && app(\App\Services\Care\CarePermissions::class)->can( + app(\App\Services\Care\OrganizationResolver::class)->memberFor(auth()->user()), 'patients.view')) + + @endif +
+ +
+ @includeIf('partials.topbar-widgets-prepend') + @include('partials.topbar-desktop-widgets', ['user' => $user, 'showUser' => true]) + @includeIf('partials.topbar-widgets-append') +
+
diff --git a/resources/views/partials/user-profile-menu.blade.php b/resources/views/partials/user-profile-menu.blade.php new file mode 100644 index 0000000..6ddfea8 --- /dev/null +++ b/resources/views/partials/user-profile-menu.blade.php @@ -0,0 +1,73 @@ +@props([ + 'items' => [], + 'user' => null, + 'showUser' => false, + 'variant' => 'dropdown', + 'onNavigate' => null, +]) + +@php + $linkClass = match ($variant) { + 'dark' => 'block rounded-md px-3 py-2 text-sm text-slate-200 hover:bg-slate-800', + 'sheet' => 'block rounded-xl px-4 py-3 text-sm font-medium text-slate-700 transition hover:bg-slate-100', + default => 'block rounded-lg px-3 py-2 text-sm text-slate-700 hover:bg-slate-100', + }; + + $logoutClass = match ($variant) { + 'dark' => 'w-full rounded-md px-3 py-2 text-left text-sm text-rose-300 hover:bg-rose-950/40', + 'sheet' => 'w-full rounded-xl px-4 py-3 text-left text-sm font-medium text-rose-600 transition hover:bg-rose-50', + default => 'w-full rounded-lg px-3 py-2 text-left text-sm text-rose-600 hover:bg-rose-50', + }; + + $logoutWrapperClass = match ($variant) { + 'sheet' => 'border-t border-slate-100 pt-2', + 'dark' => '', + default => '', + }; + + $dividerClass = match ($variant) { + 'dark' => 'my-1 border-t border-slate-800', + default => 'my-1 border-t border-slate-100', + }; + + $containerClass = match ($variant) { + 'dark' => 'mt-2 rounded-lg border border-slate-800 bg-slate-900 p-1', + 'sheet' => 'space-y-1 p-2 pb-4', + default => 'p-1', + }; +@endphp + +
merge(['class' => $containerClass]) }}> + @if ($showUser && $user) +
+

{{ $user->name ?? 'Your account' }}

+

{{ $user->email }}

+
+
+ @endif + + @foreach ($items as $item) + @if (($item['type'] ?? 'link') === 'link') + + {{ $item['label'] }} + + @elseif (($item['type'] ?? '') === 'wallet') + @includeIf('partials.wallet-widget', [ + 'onNavigate' => $onNavigate, + 'class' => $variant === 'sheet' ? 'mx-2' : 'mx-1', + ]) + @elseif (($item['type'] ?? '') === 'logout') + @if ($variant !== 'sheet') +
+ @endif +
+ @csrf + +
+ @endif + @endforeach +
diff --git a/resources/views/partials/wallet-topup-modal.blade.php b/resources/views/partials/wallet-topup-modal.blade.php new file mode 100644 index 0000000..3e348fe --- /dev/null +++ b/resources/views/partials/wallet-topup-modal.blade.php @@ -0,0 +1,24 @@ +@props(['openOnLoad' => false, 'suggested' => 10, 'min' => 1, 'returnUrl' => null]) + + +
+

Top up your wallet

+

Add funds to your Ladill wallet to continue.

+
+ +
+ @csrf + + + + +

You'll be taken to Paystack to pay securely; funds land in your Ladill wallet.

+ +
+ + +
+
+
diff --git a/resources/views/partials/wallet-widget.blade.php b/resources/views/partials/wallet-widget.blade.php new file mode 100644 index 0000000..095b2f4 --- /dev/null +++ b/resources/views/partials/wallet-widget.blade.php @@ -0,0 +1,30 @@ +{{-- Wallet balance peek (links to the account wallet on account.ladill.com). --}} +@php + $onNavigate = $onNavigate ?? null; + $class = trim((string) ($class ?? 'mx-1')); + $balanceRoute = (string) config('billing.wallet_balance_route', 'wallet.balance'); + $balanceUrl = \Illuminate\Support\Facades\Route::has($balanceRoute) ? route($balanceRoute) : null; + $walletUrl = \Illuminate\Support\Facades\Route::has('user.wallet.index') + ? route('user.wallet.index') + : (function_exists('ladill_account_url') ? ladill_account_url('/wallet') : '#'); +@endphp +@if ($balanceUrl) + + + + + + + + + Wallet balance + + + + + +@endif diff --git a/routes/api.php b/routes/api.php new file mode 100644 index 0000000..d333e8c --- /dev/null +++ b/routes/api.php @@ -0,0 +1,62 @@ + response()->json(['status' => 'ok', 'app' => 'care'])); + +Route::post('/service-events', ServiceEventController::class)->name('api.service-events'); + +Route::middleware(['auth:sanctum', 'care.setup'])->prefix('v1')->group(function () { + Route::get('/patients', [PatientController::class, 'index'])->name('api.patients.index'); + Route::post('/patients', [PatientController::class, 'store'])->name('api.patients.store'); + Route::get('/patients/{patient}', [PatientController::class, 'show'])->name('api.patients.show'); + Route::put('/patients/{patient}', [PatientController::class, 'update'])->name('api.patients.update'); + Route::delete('/patients/{patient}', [PatientController::class, 'destroy'])->name('api.patients.destroy'); + + Route::get('/appointments', [AppointmentController::class, 'index'])->name('api.appointments.index'); + Route::post('/appointments', [AppointmentController::class, 'store'])->name('api.appointments.store'); + Route::post('/appointments/walk-in', [AppointmentController::class, 'walkIn'])->name('api.appointments.walk-in'); + Route::get('/appointments/{appointment}', [AppointmentController::class, 'show'])->name('api.appointments.show'); + Route::post('/appointments/{appointment}/check-in', [AppointmentController::class, 'checkIn'])->name('api.appointments.check-in'); + Route::post('/appointments/{appointment}/cancel', [AppointmentController::class, 'cancel'])->name('api.appointments.cancel'); + + Route::get('/queue', [QueueController::class, 'index'])->name('api.queue.index'); + + Route::post('/appointments/{appointment}/consultation', [ConsultationController::class, 'start'])->name('api.consultations.start'); + Route::get('/consultations/{consultation}', [ConsultationController::class, 'show'])->name('api.consultations.show'); + Route::put('/consultations/{consultation}', [ConsultationController::class, 'update'])->name('api.consultations.update'); + Route::post('/consultations/{consultation}/complete', [ConsultationController::class, 'complete'])->name('api.consultations.complete'); + + Route::get('/investigations/catalog', [InvestigationController::class, 'catalog'])->name('api.investigations.catalog'); + Route::get('/investigations', [InvestigationController::class, 'index'])->name('api.investigations.index'); + Route::get('/investigations/queue', [InvestigationController::class, 'queue'])->name('api.investigations.queue'); + Route::post('/consultations/{consultation}/investigations', [InvestigationController::class, 'store'])->name('api.investigations.store'); + Route::get('/investigations/{investigation}', [InvestigationController::class, 'show'])->name('api.investigations.show'); + Route::post('/investigations/{investigation}/collect-sample', [InvestigationController::class, 'collectSample'])->name('api.investigations.collect-sample'); + Route::post('/investigations/{investigation}/results', [InvestigationController::class, 'enterResults'])->name('api.investigations.results'); + Route::post('/investigations/{investigation}/approve', [InvestigationController::class, 'approve'])->name('api.investigations.approve'); + + Route::get('/prescriptions', [PrescriptionController::class, 'index'])->name('api.prescriptions.index'); + Route::get('/prescriptions/queue', [PrescriptionController::class, 'queue'])->name('api.prescriptions.queue'); + Route::post('/consultations/{consultation}/prescriptions', [PrescriptionController::class, 'store'])->name('api.prescriptions.store'); + Route::get('/prescriptions/{prescription}', [PrescriptionController::class, 'show'])->name('api.prescriptions.show'); + Route::post('/prescriptions/{prescription}/dispense', [PrescriptionController::class, 'dispense'])->name('api.prescriptions.dispense'); + + Route::get('/bills', [BillController::class, 'index'])->name('api.bills.index'); + Route::post('/visits/{visit}/bill', [BillController::class, 'generate'])->name('api.bills.generate'); + Route::get('/bills/{bill}', [BillController::class, 'show'])->name('api.bills.show'); + Route::post('/bills/{bill}/payments', [BillController::class, 'recordPayment'])->name('api.bills.payments.store'); + + Route::get('/drugs', [DrugController::class, 'index'])->name('api.drugs.index'); + Route::post('/drugs', [DrugController::class, 'store'])->name('api.drugs.store'); + Route::post('/prescriptions/{prescription}/dispense-stock', [DrugController::class, 'dispense'])->name('api.prescriptions.dispense-stock'); +}); diff --git a/routes/console.php b/routes/console.php new file mode 100644 index 0000000..44217da --- /dev/null +++ b/routes/console.php @@ -0,0 +1,3 @@ + auth()->check() + ? redirect()->route('care.dashboard') + : redirect()->route('sso.connect'))->name('care.root'); + +Route::get('/login', [SsoLoginController::class, 'connect'])->name('login'); +Route::get('/sso/connect', [SsoLoginController::class, 'connect'])->name('sso.connect'); +Route::get('/sso/callback', [SsoLoginController::class, 'callback'])->name('sso.callback'); +Route::get('/sso/error', [SsoLoginController::class, 'failed'])->name('sso.failed'); +Route::post('/logout', [SsoLoginController::class, 'logout'])->name('logout'); +Route::get('/sso/logout-bridge', [SsoLoginController::class, 'logoutBridge'])->name('sso.logout-bridge'); +Route::get('/sso/logout-frontchannel', [SsoLoginController::class, 'frontchannelLogout'])->name('sso.logout-frontchannel'); +Route::get('/sso/platform-signed-out', [SsoLoginController::class, 'platformSignedOut'])->name('sso.platform-signed-out'); +Route::get('/signed-out', fn () => auth()->check() ? redirect()->route('care.dashboard') : view('auth.signed-out'))->name('care.signed-out'); + +Route::middleware(['auth', 'platform.session'])->group(function () { + Route::get('/onboarding', [OnboardingController::class, 'show'])->name('care.onboarding.show'); + Route::post('/onboarding', [OnboardingController::class, 'store'])->name('care.onboarding.store'); + + Route::middleware(['care.setup'])->group(function () { + Route::get('/dashboard', [DashboardController::class, 'index'])->name('care.dashboard'); + + Route::get('/patients', [PatientController::class, 'index'])->name('care.patients.index'); + Route::get('/patients/create', [PatientController::class, 'create'])->name('care.patients.create'); + Route::post('/patients', [PatientController::class, 'store'])->name('care.patients.store'); + Route::get('/patients/{patient}', [PatientController::class, 'show'])->name('care.patients.show'); + Route::get('/patients/{patient}/edit', [PatientController::class, 'edit'])->name('care.patients.edit'); + Route::put('/patients/{patient}', [PatientController::class, 'update'])->name('care.patients.update'); + Route::delete('/patients/{patient}', [PatientController::class, 'destroy'])->name('care.patients.destroy'); + + Route::get('/appointments', [AppointmentController::class, 'index'])->name('care.appointments.index'); + Route::get('/appointments/create', [AppointmentController::class, 'create'])->name('care.appointments.create'); + Route::post('/appointments', [AppointmentController::class, 'store'])->name('care.appointments.store'); + Route::get('/appointments/walk-in', [AppointmentController::class, 'walkInCreate'])->name('care.appointments.walk-in.create'); + Route::post('/appointments/walk-in', [AppointmentController::class, 'walkInStore'])->name('care.appointments.walk-in.store'); + Route::get('/appointments/{appointment}', [AppointmentController::class, 'show'])->name('care.appointments.show'); + Route::post('/appointments/{appointment}/check-in', [AppointmentController::class, 'checkIn'])->name('care.appointments.check-in'); + Route::post('/appointments/{appointment}/cancel', [AppointmentController::class, 'cancel'])->name('care.appointments.cancel'); + Route::post('/appointments/{appointment}/no-show', [AppointmentController::class, 'noShow'])->name('care.appointments.no-show'); + + Route::get('/queue', [QueueController::class, 'index'])->name('care.queue.index'); + Route::post('/queue/{appointment}/start', [QueueController::class, 'start'])->name('care.queue.start'); + + Route::get('/consultations/{consultation}', [ConsultationController::class, 'show'])->name('care.consultations.show'); + Route::put('/consultations/{consultation}', [ConsultationController::class, 'update'])->name('care.consultations.update'); + Route::post('/consultations/{consultation}/complete', [ConsultationController::class, 'complete'])->name('care.consultations.complete'); + + Route::get('/lab/requests', [InvestigationController::class, 'index'])->name('care.lab.requests.index'); + Route::get('/lab/queue', [InvestigationController::class, 'queue'])->name('care.lab.queue.index'); + Route::get('/lab/requests/{investigation}', [InvestigationController::class, 'show'])->name('care.lab.requests.show'); + Route::post('/consultations/{consultation}/investigations', [InvestigationController::class, 'requestFromConsultation'])->name('care.lab.requests.store'); + Route::post('/lab/requests/{investigation}/collect-sample', [InvestigationController::class, 'collectSample'])->name('care.lab.requests.collect-sample'); + Route::post('/lab/requests/{investigation}/start', [InvestigationController::class, 'startProcessing'])->name('care.lab.requests.start'); + Route::post('/lab/requests/{investigation}/results', [InvestigationController::class, 'enterResults'])->name('care.lab.requests.results'); + Route::post('/lab/requests/{investigation}/approve', [InvestigationController::class, 'approve'])->name('care.lab.requests.approve'); + Route::post('/lab/requests/{investigation}/deliver', [InvestigationController::class, 'deliver'])->name('care.lab.requests.deliver'); + Route::post('/lab/requests/{investigation}/cancel', [InvestigationController::class, 'cancel'])->name('care.lab.requests.cancel'); + + Route::get('/lab/catalog', [InvestigationTypeController::class, 'index'])->name('care.lab.catalog.index'); + Route::get('/lab/catalog/create', [InvestigationTypeController::class, 'create'])->name('care.lab.catalog.create'); + Route::post('/lab/catalog', [InvestigationTypeController::class, 'store'])->name('care.lab.catalog.store'); + Route::get('/lab/catalog/{investigationType}/edit', [InvestigationTypeController::class, 'edit'])->name('care.lab.catalog.edit'); + Route::put('/lab/catalog/{investigationType}', [InvestigationTypeController::class, 'update'])->name('care.lab.catalog.update'); + + Route::get('/prescriptions', [PrescriptionController::class, 'index'])->name('care.prescriptions.index'); + Route::get('/prescriptions/queue', [PrescriptionController::class, 'queue'])->name('care.prescriptions.queue'); + Route::get('/consultations/{consultation}/prescriptions/create', [PrescriptionController::class, 'create'])->name('care.prescriptions.create'); + Route::post('/consultations/{consultation}/prescriptions', [PrescriptionController::class, 'store'])->name('care.prescriptions.store'); + Route::get('/prescriptions/{prescription}', [PrescriptionController::class, 'show'])->name('care.prescriptions.show'); + Route::post('/prescriptions/{prescription}/activate', [PrescriptionController::class, 'activate'])->name('care.prescriptions.activate'); + Route::post('/prescriptions/{prescription}/dispense', [PrescriptionController::class, 'dispense'])->name('care.prescriptions.dispense'); + Route::post('/prescriptions/{prescription}/cancel', [PrescriptionController::class, 'cancel'])->name('care.prescriptions.cancel'); + + Route::get('/bills', [BillController::class, 'index'])->name('care.bills.index'); + Route::post('/visits/{visit}/bill', [BillController::class, 'generate'])->name('care.bills.generate'); + Route::get('/bills/{bill}', [BillController::class, 'show'])->name('care.bills.show'); + Route::get('/bills/{bill}/print', [BillController::class, 'print'])->name('care.bills.print'); + Route::post('/bills/{bill}/line-items', [BillController::class, 'addLineItem'])->name('care.bills.line-items.store'); + Route::post('/bills/{bill}/adjustments', [BillController::class, 'applyAdjustments'])->name('care.bills.adjustments'); + Route::post('/bills/{bill}/payments', [BillController::class, 'recordPayment'])->name('care.bills.payments.store'); + Route::post('/bills/{bill}/void', [BillController::class, 'void'])->name('care.bills.void'); + + Route::get('/pharmacy/drugs', [DrugController::class, 'index'])->name('care.pharmacy.drugs.index'); + Route::get('/pharmacy/drugs/create', [DrugController::class, 'create'])->name('care.pharmacy.drugs.create'); + Route::post('/pharmacy/drugs', [DrugController::class, 'store'])->name('care.pharmacy.drugs.store'); + Route::get('/pharmacy/drugs/{drug}', [DrugController::class, 'show'])->name('care.pharmacy.drugs.show'); + Route::get('/pharmacy/drugs/{drug}/edit', [DrugController::class, 'edit'])->name('care.pharmacy.drugs.edit'); + Route::put('/pharmacy/drugs/{drug}', [DrugController::class, 'update'])->name('care.pharmacy.drugs.update'); + Route::post('/pharmacy/drugs/{drug}/batches', [DrugController::class, 'receiveBatch'])->name('care.pharmacy.drugs.batches.store'); + + Route::get('/reports', [ReportController::class, 'index'])->name('care.reports.index'); + Route::get('/reports/{type}', [ReportController::class, 'show'])->name('care.reports.show'); + Route::get('/reports/{type}/export', [ReportController::class, 'export'])->name('care.reports.export'); + + Route::get('/settings', [SettingsController::class, 'edit'])->name('care.settings'); + Route::put('/settings', [SettingsController::class, 'update'])->name('care.settings.update'); + + Route::get('/branches', [BranchController::class, 'index'])->name('care.branches.index'); + Route::get('/branches/create', [BranchController::class, 'create'])->name('care.branches.create'); + Route::post('/branches', [BranchController::class, 'store'])->name('care.branches.store'); + Route::get('/branches/{branch}/edit', [BranchController::class, 'edit'])->name('care.branches.edit'); + Route::put('/branches/{branch}', [BranchController::class, 'update'])->name('care.branches.update'); + + Route::get('/departments', [DepartmentController::class, 'index'])->name('care.departments.index'); + Route::get('/departments/create', [DepartmentController::class, 'create'])->name('care.departments.create'); + Route::post('/departments', [DepartmentController::class, 'store'])->name('care.departments.store'); + Route::get('/departments/{department}/edit', [DepartmentController::class, 'edit'])->name('care.departments.edit'); + Route::put('/departments/{department}', [DepartmentController::class, 'update'])->name('care.departments.update'); + Route::delete('/departments/{department}', [DepartmentController::class, 'destroy'])->name('care.departments.destroy'); + + Route::get('/members', [MemberController::class, 'index'])->name('care.members.index'); + Route::get('/members/create', [MemberController::class, 'create'])->name('care.members.create'); + Route::post('/members', [MemberController::class, 'store'])->name('care.members.store'); + Route::delete('/members/{member}', [MemberController::class, 'destroy'])->name('care.members.destroy'); + + Route::get('/audit-logs', [AuditLogController::class, 'index'])->name('care.audit.index'); + Route::get('/audit-logs/export', [AuditLogController::class, 'export'])->name('care.audit.export'); + + Route::get('/wallet', fn () => redirect()->away(ladill_account_url('/wallet')))->name('care.wallet'); + Route::get('/team', fn () => redirect()->away(ladill_account_url('/account/team')))->name('care.team'); + }); +}); diff --git a/tests/Feature/CareAppointmentTest.php b/tests/Feature/CareAppointmentTest.php new file mode 100644 index 0000000..b936170 --- /dev/null +++ b/tests/Feature/CareAppointmentTest.php @@ -0,0 +1,230 @@ +withoutMiddleware(EnsurePlatformSession::class); + + $this->user = User::create([ + 'public_id' => 'test-user-001', + 'name' => 'Test User', + 'email' => 'test@example.com', + ]); + + $this->organization = Organization::create([ + 'owner_ref' => $this->user->public_id, + 'name' => 'Test Clinic', + 'slug' => 'test-clinic', + 'timezone' => 'UTC', + 'settings' => ['onboarded' => true], + ]); + + Member::create([ + 'owner_ref' => $this->user->public_id, + 'organization_id' => $this->organization->id, + 'user_ref' => $this->user->public_id, + 'role' => 'receptionist', + ]); + + $this->branch = Branch::create([ + 'owner_ref' => $this->user->public_id, + 'organization_id' => $this->organization->id, + 'name' => 'Main Branch', + 'is_active' => true, + ]); + + Department::create([ + 'owner_ref' => $this->user->public_id, + 'branch_id' => $this->branch->id, + 'name' => 'General Outpatient', + 'type' => 'outpatient', + 'is_active' => true, + ]); + + $this->patient = Patient::create([ + 'uuid' => (string) \Illuminate\Support\Str::uuid(), + 'owner_ref' => $this->user->public_id, + 'organization_id' => $this->organization->id, + 'branch_id' => $this->branch->id, + 'patient_number' => 'LC-2026-00001', + 'first_name' => 'Ama', + 'last_name' => 'Mensah', + ]); + + $this->practitioner = Practitioner::create([ + 'owner_ref' => $this->user->public_id, + 'organization_id' => $this->organization->id, + 'branch_id' => $this->branch->id, + 'name' => 'Dr. Kwame Asante', + 'specialty' => 'General Practice', + 'is_active' => true, + ]); + } + + public function test_appointments_index_loads(): void + { + $this->actingAs($this->user) + ->get(route('care.appointments.index')) + ->assertOk() + ->assertSee('Appointments'); + } + + public function test_can_book_appointment(): void + { + $this->actingAs($this->user) + ->post(route('care.appointments.store'), [ + 'branch_id' => $this->branch->id, + 'patient_id' => $this->patient->id, + 'practitioner_id' => $this->practitioner->id, + 'scheduled_at' => now()->addDay()->format('Y-m-d\TH:i'), + 'reason' => 'Follow-up', + ]) + ->assertRedirect(); + + $appointment = Appointment::first(); + $this->assertNotNull($appointment); + $this->assertSame(Appointment::STATUS_SCHEDULED, $appointment->status); + $this->assertDatabaseHas('care_audit_logs', ['action' => 'appointment.created']); + } + + public function test_full_appointment_workflow(): void + { + $appointment = Appointment::create([ + 'uuid' => (string) \Illuminate\Support\Str::uuid(), + 'owner_ref' => $this->user->public_id, + 'organization_id' => $this->organization->id, + 'branch_id' => $this->branch->id, + 'patient_id' => $this->patient->id, + 'practitioner_id' => $this->practitioner->id, + 'type' => Appointment::TYPE_SCHEDULED, + 'status' => Appointment::STATUS_SCHEDULED, + 'scheduled_at' => now()->addHour(), + 'reason' => 'Check-up', + ]); + + $this->actingAs($this->user) + ->post(route('care.appointments.check-in', $appointment)) + ->assertRedirect(route('care.queue.index')); + + $appointment->refresh(); + $this->assertSame(Appointment::STATUS_WAITING, $appointment->status); + $this->assertNotNull($appointment->visit_id); + $this->assertDatabaseHas('care_visits', ['patient_id' => $this->patient->id]); + + Member::where('user_ref', $this->user->public_id)->update(['role' => 'doctor']); + + $this->actingAs($this->user) + ->post(route('care.queue.start', $appointment)) + ->assertRedirect(); + + $appointment->refresh(); + $this->assertSame(Appointment::STATUS_IN_CONSULTATION, $appointment->status); + + $consultation = Consultation::first(); + $this->assertNotNull($consultation); + + $this->actingAs($this->user) + ->put(route('care.consultations.update', $consultation), [ + 'symptoms' => 'Headache and fever', + 'clinical_notes' => 'Patient appears stable.', + 'vitals' => [ + 'bp_systolic' => 120, + 'bp_diastolic' => 80, + 'pulse' => 72, + 'temperature' => 37.2, + ], + 'diagnoses' => [ + ['code' => 'R51', 'description' => 'Headache', 'is_primary' => true], + ], + ]) + ->assertRedirect(); + + $this->assertDatabaseHas('care_vital_signs', ['bp_systolic' => 120]); + $this->assertDatabaseHas('care_diagnoses', ['description' => 'Headache']); + + $this->actingAs($this->user) + ->post(route('care.consultations.complete', $consultation)) + ->assertRedirect(route('care.patients.show', $this->patient)); + + $appointment->refresh(); + $consultation->refresh(); + $this->assertSame(Appointment::STATUS_COMPLETED, $appointment->status); + $this->assertSame(Consultation::STATUS_COMPLETED, $consultation->status); + $this->assertSame(Visit::STATUS_COMPLETED, $appointment->visit->status); + } + + public function test_walk_in_registers_to_queue(): void + { + $this->actingAs($this->user) + ->post(route('care.appointments.walk-in.store'), [ + 'branch_id' => $this->branch->id, + 'patient_id' => $this->patient->id, + 'practitioner_id' => $this->practitioner->id, + 'reason' => 'Urgent visit', + ]) + ->assertRedirect(route('care.queue.index')); + + $appointment = Appointment::first(); + $this->assertSame(Appointment::TYPE_WALK_IN, $appointment->type); + $this->assertSame(Appointment::STATUS_WAITING, $appointment->status); + $this->assertNotNull($appointment->queue_position); + } + + public function test_queue_page_loads(): void + { + $this->actingAs($this->user) + ->get(route('care.queue.index', ['branch_id' => $this->branch->id])) + ->assertOk() + ->assertSee('Patient queue'); + } + + public function test_api_can_book_and_check_in(): void + { + Sanctum::actingAs($this->user); + + $response = $this->postJson('/api/v1/appointments', [ + 'branch_id' => $this->branch->id, + 'patient_id' => $this->patient->id, + 'scheduled_at' => now()->addDays(2)->toIso8601String(), + 'reason' => 'API booking', + ]); + + $response->assertCreated(); + $uuid = $response->json('uuid'); + + $this->postJson("/api/v1/appointments/{$uuid}/check-in") + ->assertOk() + ->assertJsonPath('status', Appointment::STATUS_WAITING); + } +} diff --git a/tests/Feature/CareBillTest.php b/tests/Feature/CareBillTest.php new file mode 100644 index 0000000..bc0ee5a --- /dev/null +++ b/tests/Feature/CareBillTest.php @@ -0,0 +1,161 @@ +withoutMiddleware(EnsurePlatformSession::class); + + $this->user = User::create([ + 'public_id' => 'test-user-001', + 'name' => 'Test User', + 'email' => 'test@example.com', + ]); + + $this->organization = Organization::create([ + 'owner_ref' => $this->user->public_id, + 'name' => 'Test Clinic', + 'slug' => 'test-clinic', + 'timezone' => 'UTC', + 'settings' => ['onboarded' => true], + ]); + + Member::create([ + 'owner_ref' => $this->user->public_id, + 'organization_id' => $this->organization->id, + 'user_ref' => $this->user->public_id, + 'role' => 'cashier', + ]); + + $branch = Branch::create([ + 'owner_ref' => $this->user->public_id, + 'organization_id' => $this->organization->id, + 'name' => 'Main Branch', + 'is_active' => true, + ]); + + $patient = Patient::create([ + 'uuid' => (string) \Illuminate\Support\Str::uuid(), + 'owner_ref' => $this->user->public_id, + 'organization_id' => $this->organization->id, + 'branch_id' => $branch->id, + 'patient_number' => 'LC-2026-00001', + 'first_name' => 'Kofi', + 'last_name' => 'Asante', + ]); + + $this->visit = Visit::create([ + 'uuid' => (string) \Illuminate\Support\Str::uuid(), + 'owner_ref' => $this->user->public_id, + 'organization_id' => $this->organization->id, + 'branch_id' => $branch->id, + 'patient_id' => $patient->id, + 'status' => Visit::STATUS_IN_PROGRESS, + 'checked_in_at' => now(), + ]); + + Consultation::create([ + 'uuid' => (string) \Illuminate\Support\Str::uuid(), + 'owner_ref' => $this->user->public_id, + 'visit_id' => $this->visit->id, + 'patient_id' => $patient->id, + 'status' => Consultation::STATUS_COMPLETED, + 'started_at' => now()->subHour(), + 'completed_at' => now(), + ]); + } + + public function test_cashier_can_generate_bill_from_visit(): void + { + $this->actingAs($this->user) + ->post(route('care.bills.generate', $this->visit)) + ->assertRedirect(); + + $bill = Bill::first(); + $this->assertNotNull($bill); + $this->assertSame(Bill::STATUS_OPEN, $bill->status); + $this->assertTrue($bill->lineItems()->where('type', 'consultation')->exists()); + $this->assertDatabaseHas('care_audit_logs', ['action' => 'bill.created']); + } + + public function test_cashier_can_add_line_item_and_record_payments(): void + { + $this->actingAs($this->user) + ->post(route('care.bills.generate', $this->visit)); + + $bill = Bill::firstOrFail(); + $consultationFee = (int) config('care.billing.consultation_fee_minor', 5000); + + $this->actingAs($this->user) + ->post(route('care.bills.line-items.store', $bill), [ + 'type' => 'misc', + 'description' => 'Dressing supplies', + 'quantity' => 2, + 'unit_price_minor' => 1000, + ]) + ->assertRedirect(); + + $bill->refresh(); + $expectedTotal = $consultationFee + 2000; + + $this->assertSame($expectedTotal, $bill->total_minor); + + $this->actingAs($this->user) + ->post(route('care.bills.payments.store', $bill), [ + 'amount_minor' => 3000, + 'method' => 'cash', + ]) + ->assertRedirect(); + + $bill->refresh(); + $this->assertSame(Bill::STATUS_PARTIAL, $bill->status); + $this->assertSame(3000, $bill->amount_paid_minor); + + $this->actingAs($this->user) + ->post(route('care.bills.payments.store', $bill), [ + 'amount_minor' => $bill->balance_minor, + 'method' => 'momo', + 'reference' => 'MOMO-123', + ]) + ->assertRedirect(); + + $bill->refresh(); + $this->assertSame(Bill::STATUS_PAID, $bill->status); + $this->assertSame(0, $bill->balance_minor); + $this->assertDatabaseHas('care_audit_logs', ['action' => 'payment.recorded']); + } + + public function test_bills_index_is_accessible(): void + { + $this->actingAs($this->user) + ->post(route('care.bills.generate', $this->visit)); + + $this->actingAs($this->user) + ->get(route('care.bills.index')) + ->assertOk() + ->assertSee('INV-'); + } +} diff --git a/tests/Feature/CareLabTest.php b/tests/Feature/CareLabTest.php new file mode 100644 index 0000000..c5ee76b --- /dev/null +++ b/tests/Feature/CareLabTest.php @@ -0,0 +1,217 @@ +withoutMiddleware(EnsurePlatformSession::class); + + $this->user = User::create([ + 'public_id' => 'test-user-001', + 'name' => 'Test User', + 'email' => 'test@example.com', + ]); + + $this->organization = Organization::create([ + 'owner_ref' => $this->user->public_id, + 'name' => 'Test Clinic', + 'slug' => 'test-clinic', + 'timezone' => 'UTC', + 'settings' => ['onboarded' => true], + ]); + + Member::create([ + 'owner_ref' => $this->user->public_id, + 'organization_id' => $this->organization->id, + 'user_ref' => $this->user->public_id, + 'role' => 'doctor', + ]); + + $this->branch = Branch::create([ + 'owner_ref' => $this->user->public_id, + 'organization_id' => $this->organization->id, + 'name' => 'Main Branch', + 'is_active' => true, + ]); + + Department::create([ + 'owner_ref' => $this->user->public_id, + 'branch_id' => $this->branch->id, + 'name' => 'Laboratory', + 'type' => 'laboratory', + 'is_active' => true, + ]); + + $this->patient = Patient::create([ + 'uuid' => (string) \Illuminate\Support\Str::uuid(), + 'owner_ref' => $this->user->public_id, + 'organization_id' => $this->organization->id, + 'branch_id' => $this->branch->id, + 'patient_number' => 'LC-2026-00001', + 'first_name' => 'Ama', + 'last_name' => 'Mensah', + ]); + + $visit = Visit::create([ + 'uuid' => (string) \Illuminate\Support\Str::uuid(), + 'owner_ref' => $this->user->public_id, + 'organization_id' => $this->organization->id, + 'branch_id' => $this->branch->id, + 'patient_id' => $this->patient->id, + 'status' => Visit::STATUS_IN_PROGRESS, + 'checked_in_at' => now(), + ]); + + $this->consultation = Consultation::create([ + 'uuid' => (string) \Illuminate\Support\Str::uuid(), + 'owner_ref' => $this->user->public_id, + 'visit_id' => $visit->id, + 'patient_id' => $this->patient->id, + 'status' => Consultation::STATUS_DRAFT, + 'started_at' => now(), + ]); + + $this->investigationType = InvestigationType::create([ + 'owner_ref' => $this->user->public_id, + 'organization_id' => $this->organization->id, + 'name' => 'Fasting Blood Glucose', + 'code' => 'FBG', + 'category' => 'blood', + 'unit' => 'mmol/L', + 'reference_low' => 3.9, + 'reference_high' => 6.1, + 'price_minor' => 2500, + 'is_active' => true, + ]); + } + + public function test_doctor_can_request_investigation(): void + { + $this->actingAs($this->user) + ->post(route('care.lab.requests.store', $this->consultation), [ + 'investigation_type_ids' => [$this->investigationType->id], + 'clinical_notes' => 'Suspected hyperglycemia', + 'priority' => 'routine', + ]) + ->assertRedirect(); + + $this->assertDatabaseHas('care_investigation_requests', [ + 'patient_id' => $this->patient->id, + 'status' => InvestigationRequest::STATUS_PENDING, + ]); + $this->assertDatabaseHas('care_audit_logs', ['action' => 'investigation.requested']); + } + + public function test_full_lab_workflow(): void + { + $request = InvestigationRequest::create([ + 'uuid' => (string) \Illuminate\Support\Str::uuid(), + 'owner_ref' => $this->user->public_id, + 'organization_id' => $this->organization->id, + 'branch_id' => $this->branch->id, + 'visit_id' => $this->consultation->visit_id, + 'consultation_id' => $this->consultation->id, + 'patient_id' => $this->patient->id, + 'investigation_type_id' => $this->investigationType->id, + 'status' => InvestigationRequest::STATUS_PENDING, + 'priority' => 'routine', + ]); + + Member::where('user_ref', $this->user->public_id)->update(['role' => 'lab_technician']); + + $this->actingAs($this->user) + ->post(route('care.lab.requests.collect-sample', $request)) + ->assertRedirect(); + + $request->refresh(); + $this->assertSame(InvestigationRequest::STATUS_SAMPLE_COLLECTED, $request->status); + $this->assertNotNull($request->sample_barcode); + + $this->actingAs($this->user) + ->post(route('care.lab.requests.start', $request)) + ->assertRedirect(); + + $request->refresh(); + $this->assertSame(InvestigationRequest::STATUS_IN_PROGRESS, $request->status); + + $this->actingAs($this->user) + ->post(route('care.lab.requests.results', $request), [ + 'value' => '8.5', + 'result_summary' => 'Elevated fasting glucose', + 'interpretation' => 'Repeat test recommended', + ]) + ->assertRedirect(); + + $request->refresh(); + $this->assertSame(InvestigationRequest::STATUS_AWAITING_REVIEW, $request->status); + $this->assertTrue($request->result->is_abnormal); + + $this->actingAs($this->user) + ->post(route('care.lab.requests.approve', $request)) + ->assertRedirect(); + + $request->refresh(); + $this->assertSame(InvestigationRequest::STATUS_COMPLETED, $request->status); + + $this->actingAs($this->user) + ->post(route('care.lab.requests.deliver', $request)) + ->assertRedirect(); + + $request->refresh(); + $this->assertSame(InvestigationRequest::STATUS_DELIVERED, $request->status); + } + + public function test_lab_queue_loads(): void + { + Member::where('user_ref', $this->user->public_id)->update(['role' => 'lab_technician']); + + $this->actingAs($this->user) + ->get(route('care.lab.queue.index', ['branch_id' => $this->branch->id])) + ->assertOk() + ->assertSee('Lab work queue'); + } + + public function test_api_can_request_investigation(): void + { + Sanctum::actingAs($this->user); + + $this->postJson("/api/v1/consultations/{$this->consultation->uuid}/investigations", [ + 'investigation_type_ids' => [$this->investigationType->id], + ]) + ->assertCreated() + ->assertJsonPath('data.0.patient_id', $this->patient->id); + } +} diff --git a/tests/Feature/CarePatientTest.php b/tests/Feature/CarePatientTest.php new file mode 100644 index 0000000..e9ca71f --- /dev/null +++ b/tests/Feature/CarePatientTest.php @@ -0,0 +1,184 @@ +withoutMiddleware(EnsurePlatformSession::class); + + $this->user = User::create([ + 'public_id' => 'test-user-001', + 'name' => 'Test User', + 'email' => 'test@example.com', + ]); + + $this->organization = Organization::create([ + 'owner_ref' => $this->user->public_id, + 'name' => 'Test Clinic', + 'slug' => 'test-clinic', + 'timezone' => 'UTC', + 'settings' => ['onboarded' => true], + ]); + + Member::create([ + 'owner_ref' => $this->user->public_id, + 'organization_id' => $this->organization->id, + 'user_ref' => $this->user->public_id, + 'role' => 'receptionist', + ]); + + $this->branch = Branch::create([ + 'owner_ref' => $this->user->public_id, + 'organization_id' => $this->organization->id, + 'name' => 'Main Branch', + 'is_active' => true, + ]); + + Department::create([ + 'owner_ref' => $this->user->public_id, + 'branch_id' => $this->branch->id, + 'name' => 'General Outpatient', + 'type' => 'outpatient', + 'is_active' => true, + ]); + } + + public function test_patients_index_loads(): void + { + $this->actingAs($this->user) + ->get(route('care.patients.index')) + ->assertOk() + ->assertSee('Patients'); + } + + public function test_can_register_patient(): void + { + $this->actingAs($this->user) + ->post(route('care.patients.store'), [ + 'first_name' => 'Ama', + 'last_name' => 'Mensah', + 'phone' => '+233201234567', + 'national_id' => 'GHA-123456789-0', + 'gender' => 'female', + 'date_of_birth' => '1990-05-15', + 'branch_id' => $this->branch->id, + 'allergies' => [ + ['allergen' => 'Penicillin', 'severity' => 'severe'], + ], + 'emergency_contacts' => [ + ['name' => 'Kofi Mensah', 'phone' => '+233209876543', 'is_primary' => true], + ], + ]) + ->assertRedirect(); + + $patient = Patient::first(); + $this->assertNotNull($patient); + $this->assertSame('Ama Mensah', $patient->fullName()); + $this->assertStringStartsWith('LC-', $patient->patient_number); + $this->assertDatabaseHas('care_patient_allergies', ['allergen' => 'Penicillin']); + $this->assertDatabaseHas('care_emergency_contacts', ['name' => 'Kofi Mensah']); + $this->assertDatabaseHas('care_audit_logs', ['action' => 'patient.created']); + } + + public function test_can_search_patients_by_phone(): void + { + Patient::create([ + 'uuid' => (string) \Illuminate\Support\Str::uuid(), + 'owner_ref' => $this->user->public_id, + 'organization_id' => $this->organization->id, + 'branch_id' => $this->branch->id, + 'patient_number' => 'LC-2026-00001', + 'first_name' => 'Kwame', + 'last_name' => 'Asante', + 'phone' => '+233244111222', + ]); + + $this->actingAs($this->user) + ->get(route('care.patients.index', ['q' => '244111222'])) + ->assertOk() + ->assertSee('Kwame Asante'); + } + + public function test_patient_dashboard_loads(): void + { + $patient = Patient::create([ + 'uuid' => (string) \Illuminate\Support\Str::uuid(), + 'owner_ref' => $this->user->public_id, + 'organization_id' => $this->organization->id, + 'branch_id' => $this->branch->id, + 'patient_number' => 'LC-2026-00001', + 'first_name' => 'Efua', + 'last_name' => 'Boateng', + ]); + + $this->actingAs($this->user) + ->get(route('care.patients.show', $patient)) + ->assertOk() + ->assertSee('Efua Boateng') + ->assertSee('LC-2026-00001'); + } + + public function test_api_can_list_patients(): void + { + Patient::create([ + 'uuid' => (string) \Illuminate\Support\Str::uuid(), + 'owner_ref' => $this->user->public_id, + 'organization_id' => $this->organization->id, + 'patient_number' => 'LC-2026-00001', + 'first_name' => 'Api', + 'last_name' => 'Patient', + ]); + + Sanctum::actingAs($this->user); + + $this->getJson('/api/v1/patients') + ->assertOk() + ->assertJsonPath('data.0.first_name', 'Api'); + } + + public function test_api_can_create_patient(): void + { + Sanctum::actingAs($this->user); + + $this->postJson('/api/v1/patients', [ + 'first_name' => 'Yaa', + 'last_name' => 'Owusu', + 'phone' => '+233555000111', + ]) + ->assertCreated() + ->assertJsonPath('first_name', 'Yaa'); + + $this->assertSame(1, Patient::count()); + } + + public function test_doctor_cannot_register_patient(): void + { + Member::where('user_ref', $this->user->public_id)->update(['role' => 'doctor']); + + $this->actingAs($this->user) + ->get(route('care.patients.create')) + ->assertForbidden(); + } +} diff --git a/tests/Feature/CarePharmacyInventoryTest.php b/tests/Feature/CarePharmacyInventoryTest.php new file mode 100644 index 0000000..c18ba64 --- /dev/null +++ b/tests/Feature/CarePharmacyInventoryTest.php @@ -0,0 +1,194 @@ +withoutMiddleware(EnsurePlatformSession::class); + + $this->user = User::create([ + 'public_id' => 'test-user-001', + 'name' => 'Test User', + 'email' => 'test@example.com', + ]); + + $this->organization = Organization::create([ + 'owner_ref' => $this->user->public_id, + 'name' => 'Test Clinic', + 'slug' => 'test-clinic', + 'timezone' => 'UTC', + 'settings' => ['onboarded' => true], + ]); + + Member::create([ + 'owner_ref' => $this->user->public_id, + 'organization_id' => $this->organization->id, + 'user_ref' => $this->user->public_id, + 'role' => 'pharmacist', + ]); + + $branch = Branch::create([ + 'owner_ref' => $this->user->public_id, + 'organization_id' => $this->organization->id, + 'name' => 'Main Branch', + 'is_active' => true, + ]); + + Department::create([ + 'owner_ref' => $this->user->public_id, + 'branch_id' => $branch->id, + 'name' => 'Pharmacy', + 'type' => 'pharmacy', + 'is_active' => true, + ]); + + $patient = Patient::create([ + 'uuid' => (string) \Illuminate\Support\Str::uuid(), + 'owner_ref' => $this->user->public_id, + 'organization_id' => $this->organization->id, + 'branch_id' => $branch->id, + 'patient_number' => 'LC-2026-00001', + 'first_name' => 'Ama', + 'last_name' => 'Mensah', + ]); + + $visit = Visit::create([ + 'uuid' => (string) \Illuminate\Support\Str::uuid(), + 'owner_ref' => $this->user->public_id, + 'organization_id' => $this->organization->id, + 'branch_id' => $branch->id, + 'patient_id' => $patient->id, + 'status' => Visit::STATUS_IN_PROGRESS, + 'checked_in_at' => now(), + ]); + + $consultation = Consultation::create([ + 'uuid' => (string) \Illuminate\Support\Str::uuid(), + 'owner_ref' => $this->user->public_id, + 'visit_id' => $visit->id, + 'patient_id' => $patient->id, + 'status' => Consultation::STATUS_DRAFT, + 'started_at' => now(), + ]); + + $this->prescription = Prescription::create([ + 'uuid' => (string) \Illuminate\Support\Str::uuid(), + 'owner_ref' => $this->user->public_id, + 'organization_id' => $this->organization->id, + 'visit_id' => $visit->id, + 'consultation_id' => $consultation->id, + 'patient_id' => $patient->id, + 'status' => Prescription::STATUS_ACTIVE, + 'prescribed_by' => $this->user->public_id, + ]); + + $this->prescriptionItem = $this->prescription->items()->create([ + 'owner_ref' => $this->user->public_id, + 'name' => 'Amoxicillin 500mg', + 'dosage' => '1 capsule', + 'frequency' => 'BD', + 'duration' => '7 days', + ]); + + $this->drug = Drug::create([ + 'owner_ref' => $this->user->public_id, + 'organization_id' => $this->organization->id, + 'name' => 'Amoxicillin 500mg', + 'unit' => 'capsule', + 'unit_price_minor' => 1500, + 'reorder_level' => 10, + 'is_active' => true, + ]); + + $this->batch = DrugBatch::create([ + 'owner_ref' => $this->user->public_id, + 'drug_id' => $this->drug->id, + 'batch_number' => 'AMX-001', + 'expiry_date' => now()->addYear()->toDateString(), + 'quantity_on_hand' => 50, + 'cost_minor' => 1000, + 'received_at' => now(), + ]); + } + + public function test_pharmacist_can_manage_drug_inventory(): void + { + $this->actingAs($this->user) + ->get(route('care.pharmacy.drugs.index')) + ->assertOk() + ->assertSee('Amoxicillin 500mg'); + + $this->actingAs($this->user) + ->get(route('care.pharmacy.drugs.show', $this->drug)) + ->assertOk() + ->assertSee('AMX-001'); + + $this->actingAs($this->user) + ->post(route('care.pharmacy.drugs.batches.store', $this->drug), [ + 'batch_number' => 'AMX-002', + 'expiry_date' => now()->addMonths(6)->toDateString(), + 'quantity_on_hand' => 20, + 'cost_minor' => 1100, + ]) + ->assertRedirect(); + + $this->assertDatabaseHas('care_drug_batches', ['batch_number' => 'AMX-002']); + $this->assertDatabaseHas('care_audit_logs', ['action' => 'drug.batch_received']); + } + + public function test_dispense_with_stock_deducts_batch_quantity(): void + { + $this->actingAs($this->user) + ->post(route('care.prescriptions.dispense', $this->prescription), [ + 'allocations' => [ + [ + 'prescription_item_id' => $this->prescriptionItem->id, + 'drug_batch_id' => $this->batch->id, + 'quantity' => 14, + ], + ], + ]) + ->assertRedirect(route('care.prescriptions.queue')); + + $this->batch->refresh(); + $this->prescription->refresh(); + + $this->assertSame(36, $this->batch->quantity_on_hand); + $this->assertSame(Prescription::STATUS_DISPENSED, $this->prescription->status); + $this->assertSame(1, DispensingRecord::count()); + $this->assertDatabaseHas('care_audit_logs', ['action' => 'prescription.dispensed']); + } +} diff --git a/tests/Feature/CarePrescriptionTest.php b/tests/Feature/CarePrescriptionTest.php new file mode 100644 index 0000000..1813097 --- /dev/null +++ b/tests/Feature/CarePrescriptionTest.php @@ -0,0 +1,179 @@ +withoutMiddleware(EnsurePlatformSession::class); + + $this->user = User::create([ + 'public_id' => 'test-user-001', + 'name' => 'Test User', + 'email' => 'test@example.com', + ]); + + $this->organization = Organization::create([ + 'owner_ref' => $this->user->public_id, + 'name' => 'Test Clinic', + 'slug' => 'test-clinic', + 'timezone' => 'UTC', + 'settings' => ['onboarded' => true], + ]); + + Member::create([ + 'owner_ref' => $this->user->public_id, + 'organization_id' => $this->organization->id, + 'user_ref' => $this->user->public_id, + 'role' => 'doctor', + ]); + + $branch = Branch::create([ + 'owner_ref' => $this->user->public_id, + 'organization_id' => $this->organization->id, + 'name' => 'Main Branch', + 'is_active' => true, + ]); + + Department::create([ + 'owner_ref' => $this->user->public_id, + 'branch_id' => $branch->id, + 'name' => 'Pharmacy', + 'type' => 'pharmacy', + 'is_active' => true, + ]); + + $patient = Patient::create([ + 'uuid' => (string) \Illuminate\Support\Str::uuid(), + 'owner_ref' => $this->user->public_id, + 'organization_id' => $this->organization->id, + 'branch_id' => $branch->id, + 'patient_number' => 'LC-2026-00001', + 'first_name' => 'Kofi', + 'last_name' => 'Asante', + ]); + + $visit = Visit::create([ + 'uuid' => (string) \Illuminate\Support\Str::uuid(), + 'owner_ref' => $this->user->public_id, + 'organization_id' => $this->organization->id, + 'branch_id' => $branch->id, + 'patient_id' => $patient->id, + 'status' => Visit::STATUS_IN_PROGRESS, + 'checked_in_at' => now(), + ]); + + $this->consultation = Consultation::create([ + 'uuid' => (string) \Illuminate\Support\Str::uuid(), + 'owner_ref' => $this->user->public_id, + 'visit_id' => $visit->id, + 'patient_id' => $patient->id, + 'status' => Consultation::STATUS_DRAFT, + 'started_at' => now(), + ]); + } + + public function test_doctor_can_create_prescription(): void + { + $this->actingAs($this->user) + ->post(route('care.prescriptions.store', $this->consultation), [ + 'activate' => true, + 'items' => [ + [ + 'name' => 'Paracetamol 500mg', + 'dosage' => '1 tablet', + 'frequency' => 'TDS', + 'duration' => '5 days', + 'route' => 'oral', + ], + [ + 'is_procedure' => true, + 'name' => 'Wound dressing', + 'instructions' => 'Daily for 3 days', + ], + ], + ]) + ->assertRedirect(); + + $prescription = Prescription::first(); + $this->assertNotNull($prescription); + $this->assertSame(Prescription::STATUS_ACTIVE, $prescription->status); + $this->assertSame(2, $prescription->items()->count()); + $this->assertDatabaseHas('care_audit_logs', ['action' => 'prescription.created']); + } + + public function test_pharmacist_can_dispense_from_queue(): void + { + $prescription = Prescription::create([ + 'uuid' => (string) \Illuminate\Support\Str::uuid(), + 'owner_ref' => $this->user->public_id, + 'organization_id' => $this->organization->id, + 'visit_id' => $this->consultation->visit_id, + 'consultation_id' => $this->consultation->id, + 'patient_id' => $this->consultation->patient_id, + 'status' => Prescription::STATUS_ACTIVE, + 'prescribed_by' => $this->user->public_id, + ]); + + $prescription->items()->create([ + 'owner_ref' => $this->user->public_id, + 'name' => 'Amoxicillin 500mg', + 'dosage' => '1 capsule', + 'frequency' => 'BD', + 'duration' => '7 days', + ]); + + Member::where('user_ref', $this->user->public_id)->update(['role' => 'pharmacist']); + + $this->actingAs($this->user) + ->get(route('care.prescriptions.queue')) + ->assertOk() + ->assertSee('Amoxicillin 500mg'); + + $this->actingAs($this->user) + ->post(route('care.prescriptions.dispense', $prescription)) + ->assertRedirect(route('care.prescriptions.queue')); + + $prescription->refresh(); + $this->assertSame(Prescription::STATUS_DISPENSED, $prescription->status); + $this->assertDatabaseHas('care_audit_logs', ['action' => 'prescription.dispensed']); + } + + public function test_api_can_create_prescription(): void + { + Sanctum::actingAs($this->user); + + $this->postJson("/api/v1/consultations/{$this->consultation->uuid}/prescriptions", [ + 'activate' => true, + 'items' => [ + ['name' => 'Ibuprofen 400mg', 'dosage' => '1 tablet', 'frequency' => 'PRN'], + ], + ]) + ->assertCreated() + ->assertJsonPath('status', Prescription::STATUS_ACTIVE); + } +} diff --git a/tests/Feature/CareReportTest.php b/tests/Feature/CareReportTest.php new file mode 100644 index 0000000..0e70a0f --- /dev/null +++ b/tests/Feature/CareReportTest.php @@ -0,0 +1,81 @@ +withoutMiddleware(EnsurePlatformSession::class); + + $this->user = User::create([ + 'public_id' => 'test-user-001', + 'name' => 'Test User', + 'email' => 'test@example.com', + ]); + + $this->organization = Organization::create([ + 'owner_ref' => $this->user->public_id, + 'name' => 'Test Clinic', + 'slug' => 'test-clinic', + 'timezone' => 'UTC', + 'settings' => ['onboarded' => true], + ]); + + Member::create([ + 'owner_ref' => $this->user->public_id, + 'organization_id' => $this->organization->id, + 'user_ref' => $this->user->public_id, + 'role' => 'accountant', + ]); + + Branch::create([ + 'owner_ref' => $this->user->public_id, + 'organization_id' => $this->organization->id, + 'name' => 'Main Branch', + 'is_active' => true, + ]); + } + + public function test_accountant_can_view_reports(): void + { + $this->actingAs($this->user) + ->get(route('care.reports.index')) + ->assertOk() + ->assertSee('Reports'); + + $this->actingAs($this->user) + ->get(route('care.reports.show', 'finance')) + ->assertOk() + ->assertSee('Finance'); + } + + public function test_accountant_can_export_report_csv(): void + { + $response = $this->actingAs($this->user) + ->get(route('care.reports.export', [ + 'type' => 'finance', + 'from' => now()->subDays(7)->toDateString(), + 'to' => now()->toDateString(), + ])); + + $response->assertOk(); + $response->assertHeader('content-type', 'text/csv; charset=UTF-8'); + $this->assertStringContainsString('Metric', $response->streamedContent()); + } +} diff --git a/tests/Feature/CareServiceEventTest.php b/tests/Feature/CareServiceEventTest.php new file mode 100644 index 0000000..bd34162 --- /dev/null +++ b/tests/Feature/CareServiceEventTest.php @@ -0,0 +1,94 @@ + $this->secret]); + } + + public function test_rejects_invalid_signature(): void + { + $this->postJson('/api/service-events', [ + 'event' => 'user.deleted', + 'data' => ['user' => 'user-001'], + ], ['X-Ladill-Signature' => 'sha256=bad']) + ->assertUnauthorized(); + } + + public function test_user_deleted_event_removes_local_mirror(): void + { + $user = User::create([ + 'public_id' => 'user-001', + 'name' => 'Deleted User', + 'email' => 'deleted@example.com', + ]); + + $organization = Organization::create([ + 'owner_ref' => 'owner-001', + 'name' => 'Test Clinic', + 'slug' => 'test-clinic', + 'timezone' => 'UTC', + 'settings' => ['onboarded' => true], + ]); + + Member::create([ + 'owner_ref' => 'owner-001', + 'organization_id' => $organization->id, + 'user_ref' => 'user-001', + 'role' => 'doctor', + ]); + + $payload = json_encode([ + 'event' => 'user.deleted', + 'data' => ['user' => 'user-001'], + ], JSON_THROW_ON_ERROR); + + $this->postJson('/api/service-events', json_decode($payload, true), [ + 'X-Ladill-Signature' => ServiceEventSignature::sign($payload, $this->secret), + 'X-Ladill-Event-Id' => 'evt-delete-001', + ])->assertOk()->assertJson(['status' => 'accepted']); + + $this->assertDatabaseMissing('users', ['public_id' => 'user-001']); + $this->assertDatabaseMissing('care_members', ['user_ref' => 'user-001']); + } + + public function test_organization_updated_event_syncs_name(): void + { + Organization::create([ + 'owner_ref' => 'owner-001', + 'name' => 'Old Name', + 'slug' => 'old-name', + 'timezone' => 'UTC', + 'settings' => ['onboarded' => true], + ]); + + $payload = json_encode([ + 'event' => 'organization.updated', + 'data' => ['owner' => 'owner-001', 'name' => 'New Clinic Name'], + ], JSON_THROW_ON_ERROR); + + $this->postJson('/api/service-events', json_decode($payload, true), [ + 'X-Ladill-Signature' => ServiceEventSignature::sign($payload, $this->secret), + ])->assertOk(); + + $this->assertDatabaseHas('care_organizations', [ + 'owner_ref' => 'owner-001', + 'name' => 'New Clinic Name', + ]); + } +} diff --git a/tests/Feature/CareWebTest.php b/tests/Feature/CareWebTest.php new file mode 100644 index 0000000..0f42050 --- /dev/null +++ b/tests/Feature/CareWebTest.php @@ -0,0 +1,133 @@ +withoutMiddleware(EnsurePlatformSession::class); + + $this->user = User::create([ + 'public_id' => 'test-user-001', + 'name' => 'Test User', + 'email' => 'test@example.com', + ]); + + $this->organization = Organization::create([ + 'owner_ref' => $this->user->public_id, + 'name' => 'Test Clinic', + 'slug' => 'test-clinic', + 'timezone' => 'UTC', + 'settings' => ['onboarded' => true, 'facility_type' => 'clinic'], + ]); + + Member::create([ + 'owner_ref' => $this->user->public_id, + 'organization_id' => $this->organization->id, + 'user_ref' => $this->user->public_id, + 'role' => 'hospital_admin', + ]); + + $branch = Branch::create([ + 'owner_ref' => $this->user->public_id, + 'organization_id' => $this->organization->id, + 'name' => 'Main Branch', + 'is_active' => true, + ]); + + Department::create([ + 'owner_ref' => $this->user->public_id, + 'branch_id' => $branch->id, + 'name' => 'General Outpatient', + 'type' => 'outpatient', + 'is_active' => true, + ]); + } + + public function test_guest_is_redirected_to_sso(): void + { + $this->get('/dashboard')->assertRedirect(); + } + + public function test_unonboarded_user_is_redirected_to_onboarding(): void + { + Organization::query()->delete(); + Member::query()->delete(); + + $this->actingAs($this->user) + ->get(route('care.dashboard')) + ->assertRedirect(route('care.onboarding.show')); + } + + public function test_dashboard_loads_for_authenticated_user(): void + { + $this->actingAs($this->user) + ->get(route('care.dashboard')) + ->assertOk() + ->assertSee('Test Clinic'); + } + + public function test_onboarding_creates_organization(): void + { + Organization::query()->delete(); + Member::query()->delete(); + Branch::query()->delete(); + Department::query()->delete(); + + $this->actingAs($this->user) + ->post(route('care.onboarding.store'), [ + 'organization_name' => 'Accra Medical Centre', + 'facility_type' => 'hospital', + 'branch_name' => 'Head Office', + 'branch_address' => '123 Main St', + 'branch_phone' => '+233201234567', + 'timezone' => 'Africa/Accra', + ]) + ->assertRedirect(route('care.dashboard')); + + $this->assertDatabaseHas('care_organizations', ['name' => 'Accra Medical Centre']); + $this->assertDatabaseHas('care_branches', ['name' => 'Head Office']); + $this->assertDatabaseHas('care_departments', ['name' => 'General Outpatient']); + } + + public function test_branches_index_loads(): void + { + $this->actingAs($this->user) + ->get(route('care.branches.index')) + ->assertOk() + ->assertSee('Main Branch'); + } + + public function test_members_index_loads(): void + { + $this->actingAs($this->user) + ->get(route('care.members.index')) + ->assertOk() + ->assertSee('test-user-001'); + } + + public function test_audit_log_index_loads(): void + { + $this->actingAs($this->user) + ->get(route('care.audit.index')) + ->assertOk() + ->assertSee('Audit log'); + } +} diff --git a/tests/TestCase.php b/tests/TestCase.php new file mode 100644 index 0000000..eece6d4 --- /dev/null +++ b/tests/TestCase.php @@ -0,0 +1,14 @@ +withoutVite(); + } +} diff --git a/tests/Unit/ExampleTest.php b/tests/Unit/ExampleTest.php new file mode 100644 index 0000000..5773b0c --- /dev/null +++ b/tests/Unit/ExampleTest.php @@ -0,0 +1,16 @@ +assertTrue(true); + } +} diff --git a/vite.config.js b/vite.config.js new file mode 100644 index 0000000..f35b4e7 --- /dev/null +++ b/vite.config.js @@ -0,0 +1,18 @@ +import { defineConfig } from 'vite'; +import laravel from 'laravel-vite-plugin'; +import tailwindcss from '@tailwindcss/vite'; + +export default defineConfig({ + plugins: [ + laravel({ + input: ['resources/css/app.css', 'resources/js/app.js'], + refresh: true, + }), + tailwindcss(), + ], + server: { + watch: { + ignored: ['**/storage/framework/views/**'], + }, + }, +});