# Libra - Coding Standards > Extracted from `docs/architecture.md` Section 20 ## Critical Rules | Rule | Description | |------|-------------| | **Volt Pattern** | Use class-based Volt components (per CLAUDE.md) | | **Flux UI** | Use Flux components when available | | **Form Validation** | Always use Form Request or Livewire form objects | | **Eloquent** | Prefer `Model::query()` over `DB::` facade | | **Actions** | Use single-purpose Action classes for business logic | | **Testing** | Every feature must have corresponding Pest tests | | **Pint** | Run `vendor/bin/pint --dirty` before committing | ## Naming Conventions | Element | Convention | Example | |---------|------------|---------| | Models | Singular PascalCase | `Consultation` | | Tables | Plural snake_case | `consultations` | | Columns | snake_case | `booking_date` | | Controllers | PascalCase + Controller | `ConsultationController` | | Actions | Verb + Noun + Action | `CreateConsultationAction` | | Jobs | Verb + Noun | `SendBookingNotification` | | Events | Past tense | `ConsultationApproved` | | Listeners | Verb phrase | `SendApprovalNotification` | | Volt Components | kebab-case path | `admin/consultations/index` | | Enums | PascalCase | `ConsultationStatus` | | Enum Cases | PascalCase | `NoShow` | | Traits | Adjective or -able | `HasConsultations`, `Bookable` | | Interfaces | Adjective or -able | `Exportable` | ## Volt Component Template ```php resetPage(); } public function updatedStatus(): void { $this->resetPage(); } public function with(): array { return [ 'consultations' => Consultation::query() ->with('user:id,full_name,email') ->when($this->search, fn ($q) => $q->whereHas('user', fn ($q) => $q->where('full_name', 'like', "%{$this->search}%") )) ->when($this->status, fn ($q) => $q->where('status', $this->status)) ->orderBy('booking_date', 'desc') ->paginate(15), 'statuses' => ConsultationStatus::cases(), ]; } }; ?>