rakphao/laravel-12-livewire-3-fluxui-2-tailwind-4 icon
public
Published on 8/31/2025
Laravel 12 + Livewire 3 + Flux UI 2 + Tailwind 4

Rules

PHP

  • Leverage PHP 8.3+ features (typed properties, match expressions, readonly classes, enums)
  • Comply with PSR-12 coding standards
  • Enforce strict typing with declare(strict_types=1);
  • Use #[\Override] attribute for all overridden methods
  • Declare class constants with explicit types and visibility
  • Choose descriptive names for variables and methods
  • Apply object-oriented programming with SOLID principles
  • Use first-class callable syntax where applicable
  • Use json_validate() for safe JSON validation
  • Adopt readonly classes for DTOs and service response models

Laravel

  • You are an expert in Laravel 12, PHP 8.3+, and web development technologies
  • Follow Laravel's MVC architecture and directory structure
  • Adhere to Laravel best practices and conventions
  • Prioritize dependency injection and service containers
  • Use attribute-based routing when applicable
  • Implement request validation using Form Requests with ValidationRule interface
  • Use Laravel's authentication and authorization features
  • Apply CSRF protection and security measures
  • Implement effective error handling with custom exceptions
  • Utilize caching mechanisms for performance enhancement
  • Implement job queues for long-running tasks
  • Use Laravel's pagination features
  • Employ Laravel's scheduling for recurring tasks
  • Leverage event and listener system for decoupled functionality
  • Prefer PestPHP for new tests, PHPUnit for complex features
  • Implement API versioning for public endpoints
  • Use API resource transformations correctly
  • Utilize localization features for multilingual support
  • Migrate helper calls to class-based alternatives (Str, to_route)
  • Use Laravel Mix/Vite for asset compilation
  • Name directories in lowercase with dashes
  • Use typed enums for status/value casting in models
  • Use readonly properties for immutable service dependencies
  • Apply route middleware using Laravel 12's updated group syntax
  • Refactor Handler using reportUsing() and renderUsing() for cleaner error reporting

Livewire

  • Use Livewire 3 component patterns and lifecycle hooks
  • Implement proper property binding and validation in Livewire components
  • Follow Livewire 3 best practices for component structure
  • Use Livewire's wire:model for two-way data binding
  • Implement Livewire component communication patterns
  • Handle Livewire component lifecycle methods appropriately
  • Use proper mount() method when needed
  • Include render() method with appropriate view
  • Follow Livewire 3 attribute and method naming conventions

Flux UI

  • Implement Flux UI 2.X components with proper styling
  • Use Flux UI form elements (input, select, textarea, etc.)
  • Follow Flux UI component patterns and conventions
  • Integrate Flux UI components with Livewire seamlessly
  • Apply Flux UI accessibility features and best practices
  • Use proper form structure and validation with Flux UI
  • Include error handling and display with Flux UI components

Tailwind

  • Use Tailwind 4 utility classes and modern CSS features
  • Implement responsive design with Tailwind breakpoints
  • Apply Tailwind's spacing and typography utilities
  • Use Tailwind's color system and design tokens
  • Implement dark mode support with Tailwind classes
  • Follow Tailwind CSS best practices for maintainable styles
  • Use Tailwind's container queries and modern layout features
  • Apply proper accessibility considerations with Tailwind utilities

Database & ORM

  • Utilize Laravel's Eloquent ORM over raw SQL queries
  • Apply proper database migrations, seeders, and relationships
  • Implement the Repository pattern for data access layer
  • Use database transactions for data integrity
  • Ensure efficient database indexing for performance
  • Establish proper Eloquent model relationships
  • Use Eloquent query builder for complex database interactions
  • Implement proper database seeding and factory patterns
  • Apply database best practices for scalability and performance
  • Use proper foreign key constraints and cascading
  • Implement soft deletes when appropriate
  • Use database observers for model events
  • Apply proper database normalization principles