composer setupThis single command runs the complete setup: installs dependencies, copies .env, generates app key, runs migrations, installs npm packages, and builds assets.
# Install PHP dependencies
composer install
# Copy environment file and configure
cp .env.example .env
# Generate application key
php artisan key:generate
# Run database migrations
php artisan migrate
# Install Node dependencies
npm install
# Build frontend assets
npm run buildBefore moving to the next feature, ALL changes must be:
-
Committed with Clear Messages:
git add . git commit -m "feat(module): descriptive message following conventional commits"
- Use conventional commit format:
feat:,fix:,docs:,test:,refactor:, etc. - Include scope when applicable:
feat(api):,fix(ui):,test(auth): - Write descriptive messages that explain WHAT changed and WHY
- Use conventional commit format:
-
Pushed to Remote Repository:
git push origin <branch-name>
- Never leave completed features uncommitted
- Push regularly to maintain backup and enable collaboration
- Ensure CI/CD pipelines pass before considering feature complete
-
Branch Hygiene:
- Work on feature branches, never directly on
main - Branch naming convention:
feature/<feature-name>,fix/<issue-name>,docs/<doc-update> - Create pull requests for all significant changes
- Work on feature branches, never directly on
Key .env variables to configure:
DB_DATABASE,DB_USERNAME,DB_PASSWORD- MySQL connectionREDIS_HOST,REDIS_PORT- Redis for cache/sessionsAPP_DOMAIN- Local domain (default: aba.test for Herd)
- PHP: 8.4
- Laravel: v12 (streamlined structure since Laravel 11)
- Filament: v4 (SDUI framework)
- Livewire: v3
- Tailwind CSS: v4
- Testing: Pest v4
# Run all tests (clears cache first)
composer run test
# Run specific test file
php artisan test tests/Feature/SomeTest.php
# Run with filter
php artisan test --filter=SomeTest
# Static analysis
composer run test:phpstan
# Production build (frontend assets)
npm run build
# Deploy Filament assets after JS/CSS changes
php artisan filament:assets
# Code formatting
composer run pint
# Completely rebuild the database (migrations and seed data)
composer run db:reset- NO NEW MIGRATIONS: Do not create new migration files during early development
- MODIFY EXISTING: Edit existing migration files directly to keep schema clean
- REBUILD: Apply changes by running
php artisan migrate:fresh --seed
- ALWAYS SYNC: When you change a migration or model, immediately update the corresponding Factory and Seeder
- VERIFY: Ensure
php artisan db:seedruns successfully - CONSISTENCY: Keep seed data consistent with expected application state
- TEST DATA: Use realistic data in factories for better testing scenarios
- All code must pass typecheck (
./vendor/bin/phpstan analyse) - Run
vendor/bin/pint --dirtybefore commits - Migrations must run successfully with
php artisan migrate:fresh --seed - Use private disk for sensitive file uploads (insurance cards, documents)
- Follow HIPAA compliance for PHI data handling
- Frameworks: Laravel v12, Filament v4, Livewire v3, Tailwind v4.
- Strict Imports:
- Schemas: Import from
Filament\Schemas\Components\*. NEVER useFilament\Forms\Components\*. - Actions: Import from
Filament\Actions\*. NEVER useFilament\Tables\Actions\*.
- Schemas: Import from
- Naming:
- Classes: Suffix with type (e.g.,
ConvertLeadToClientAction,LeadProfileObserver). - Database:
snake_casecolumns. Index names < 64 chars (use prefixes likesip_,rpc_). - Enums:
TitleCasekeys. ImplementHasLabel,HasColor,HasIconviaKongulov\Traits\InteractWithEnum.
- Classes: Suffix with type (e.g.,
- Laravel Best Practices:
- Use
Model::query()(notDB::). - Prefer Eloquent relationships over raw queries.
- Use Form Requests for validation.
- Queue time-consuming operations.
- Use
- Livewire Integration: Use
ViewFieldwith Blade views to embed components. - Custom Pages: Implement
HasTable,InteractsWithTable, and definetable()for custom tables. - Assets: Always run
npm run build && php artisan filament:assetsafter CSS/JS changes. - Virtual Groups: Use
getKeyFromRecordUsing+scopeQueryByKeyUsingfor computed groupings.
- Tooling: Pest v4 (LazilyRefreshDatabase enabled). Browser tests (
dev-browserskill) for UI. - Filament Tests:
- Table Actions:
mountTableAction->set->callMountedTableAction. - Page Actions:
mountAction->set->callMountedAction. - Wizards: Use
set('data.field', val)(notfillForm).
- Table Actions:
- Context: Call
setPermissionsTeamId($company->id)for roles. - Data: Use
UploadedFile::fake()->create(...).