Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Elian-D/ORVIAN/llms.txt

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

ORVIAN supports two onboarding paths: the platform Owner creating a school directly from the admin panel, and a school registering itself via the public sign-up page. Both flows lead into a wizard that configures the school’s academic structure, geographic data, and subscription plan. The Owner flow additionally creates the initial Director account. When the wizard completes, listener classes and post-commit callbacks fire to build the full tenant environment.

Owner-Initiated Setup

The Owner accesses /admin/setup, which renders the SchoolWizard Livewire component — a 5-step guided form backed by BaseSchoolWizard inheritance.
StepContent
1 — School DataInstitution name, SIGERD code, phone, management regime, and modality
2 — Geographic InfoProvince, municipality, regional education authority, and educational district (cascaded selectors)
3 — Academic StructureEducation levels, shifts, section labels, academic year dates, and optional technical titles for upper-secondary
4 — Plan SelectionChoose a subscription plan from the active plan catalog
5 — Director AccountName, email, and password for the initial School Principal user
On confirmation, CompleteOnboardingAction is called. It creates the school record, provisions the Director user account, and fires the SchoolConfigured event inside a database transaction.

Self-Registration Flow

A school administrator visits /sign-up. The RegisterUser Livewire component creates a stub school — a minimal school record with no academic structure yet. The administrator is then directed to the TenantSetupWizard, a 4-step variant of the same wizard that covers the same Steps 1–4 (School Data, Geographic Info, Academic Structure, and Plan Selection). The currently authenticated user is assigned the School Principal role automatically — no separate Director form is shown. On completion, CompleteTenantOnboardingAction updates the stub school with the wizard data and fires SchoolConfigured using the same event pipeline.

What Happens on Completion

When SchoolConfigured fires, two listener classes handle post-onboarding setup. They are registered via manual Event::listen calls (not auto-discovered):
  • SetupAcademicStructure — reads the wizard configuration and creates all SchoolSection records for every configured level, shift, and section label.
  • CreateInitialAcademicYear — creates the first AcademicYear record using the start and end dates provided during the wizard.
In addition, ChatwootService::syncUserAsAgent() is called directly inside the action (not via a listener). This call is placed in DB::afterCommit to ensure it only runs after the outer transaction commits successfully, avoiding nested-transaction callback issues.

School Settings

After onboarding, Directors manage their school’s institutional profile at /app/settings/school — rendered by the SchoolSettings Livewire component (App\Livewire\App\Settings\SchoolSettings). This page requires the settings.view or settings.update permission. The settings form covers:
  • School logo — upload or replace the institutional logo (JPG, PNG, WEBP, max 2 MB). The previous file is deleted from storage/app/public/schools/{id}/branding/ before the new one is stored.
  • Institutional data — name, SIGERD code, phone number, address detail, management regime (regimen_gestion), and modality.
  • Geographic cascade selectors — powered by the GeographicSelects component. Selecting a province resets the municipality; selecting a regional education authority resets the educational district.
  • Active academic year — displayed as a read-only field. The value is the name of the AcademicYear where is_active = true for the current school.
The same logo upload and location saving logic is also available to the Owner from the admin detail view at /admin/schools/{school} (SchoolShow component).

School Status

Every school has two independent boolean status flags:
FlagMeaning
is_activeWhether the school is fully operational in the platform. Set to true after successful onboarding.
is_suspendedWhether the school has been suspended due to payment issues. A school can be active but suspended.
The EnsureSchoolIsActive middleware intercepts every request to /app/* routes and enforces these rules:
  • If is_suspended = true → redirect to the suspended.notice view.
  • If is_active = false → redirect to the inactive.notice view.
The Owner can toggle both flags from /admin/schools/{school} (SchoolShow) or from the list at /admin/schools (SchoolIndex). ORVIAN enforces a business rule: a school must be suspended before it can be deactivated. Attempting to deactivate an active, non-suspended school returns a validation error notification.
ORVIAN integrates Google Maps in the school profile page (SchoolShow). Owners can drag a map pin to set the school’s precise coordinates, which are saved via saveLocation($lat, $lng). Requires GOOGLE_MAPS_API_KEY to be set in your .env. If coordinates are null or the API key is missing, the map section renders a graceful visual fallback without breaking the page.

Build docs developers (and LLMs) love