Laravel Constants & Configuration

•
137
•

Refactors hardcoded values into maintainable constants, PHP 8.1 enums, and centralized configuration files.

This skill empowers Claude to identify and eliminate 'magic numbers' and hardcoded strings within Laravel applications by implementing robust architectural patterns. It guides the transition to PHP 8.1+ enums for state management, organizes application-wide and feature-specific settings into configuration files, and establishes standardized constants for validation, HTTP responses, and service-layer logic. By centralizing these values, developers can ensure their codebase remains refactorable, debuggable, and consistent across different environments, adhering to modern Laravel best practices.

Características Principales

01Implementation of database-driven settings with automated caching strategies.
02Automated conversion of magic values to PHP 8.1 Enums with custom labels and logic.
03Standardization of validation regex and constraints for cross-component consistency.
04137 GitHub stars
05Organization of business settings into structured Laravel configuration files.
06Centralized management of HTTP status codes and API response structures.

Casos de Uso

01Moving business logic variables like tax rates or shipping thresholds to config files.
02Refactoring legacy controllers containing scattered hardcoded strings for roles and statuses.
03Establishing a unified system for cache keys and queue priorities to prevent collisions.