Owner: Dev Team | Last Updated: 2026-02-21 | Status: Current
Code standards for backend (PHP/Laravel) and frontend (TypeScript/Vue).
The project follows the PSR-12 standard for PHP code.
Automatic formatting via Laravel Pint:
# Format all files
./vendor/bin/pint
# Check without changes
./vendor/bin/pint --test
Configuration: pint.json
| Entity | Convention | Example |
|---|---|---|
| Class | PascalCase | BookingService |
| Method | camelCase | createBooking() |
| Variable | camelCase | $bookingCost |
| Constant | UPPER_SNAKE | GIFT_CARD_VALID_DAYS |
| Model | Singular PascalCase | Experience, OrderExperience |
| Controller | PascalCase + Controller | BookingController |
| Service | PascalCase + Service | BookingService |
| Repository | PascalCase + Repository | BookingRepository |
| Action | PascalCase + Action | OrderPaidAction |
| DTO | PascalCase + DTO | BookingCostDTO |
| Request | PascalCase + Request | CreateBookingRequest |
| Enum | PascalCase | BookingStatus |
| Migration | snake_case with timestamp | 2026_01_15_create_orders_table |
app/Services/app/Repositories/app/Constants/app/Enums/class BookingController extends Controller
{
public function __construct(
private readonly BookingService $bookingService
) {}
public function store(CreateBookingRequest $request)
{
$dto = $request->toDTO();
$result = $this->bookingService->createBooking($dto);
return redirect()->route('bookings.show', $result->id);
}
}
# Lint and fix
npm run lint
Configuration: .eslintrc.cjs
Configuration: .prettierrc
Plugins:
prettier-plugin-organize-imports -- auto-sort importsprettier-plugin-tailwindcss -- sort Tailwind classes| Entity | Convention | Example |
|---|---|---|
| Component | PascalCase | BookingTable.vue |
| Composable | camelCase with use |
useDebounce.ts |
| Store | camelCase | bookingStore.ts |
| REST client | camelCase | bookingApi.ts |
| Type/Interface | PascalCase | BookingResponse |
| Variable | camelCase | bookingData |
| Constant | UPPER_SNAKE | MAX_TICKETS |
| CSS class | kebab-case (Tailwind) | text-primary-600 |
<script setup lang="ts">
// 1. Imports
import { ref, computed } from 'vue'
import type { Experience } from '@/types'
// 2. Props
const props = defineProps<{
experience: Experience
}>()
// 3. Emits
const emit = defineEmits<{
(e: 'update', value: Experience): void
}>()
// 4. Reactive state
const isLoading = ref(false)
// 5. Computed
const formattedPrice = computed(() => `$${props.experience.price}`)
// 6. Methods
function handleUpdate() { ... }
</script>
<template>
<!-- Template here -->
</template>
Checking for circular dependencies:
# JavaScript/TypeScript
npm run check-deps
# PHP
npm run check-deps-php
# All
npm run check-all-deps
| Date | Author | Change |
|---|---|---|
| 2026-02-21 | Documentation Team | Initial creation |
Next: Testing Standards | Up: Contributing