Tag

Attribute

0 views collected around this technical thread.

php中文网 Courses
php中文网 Courses
May 9, 2024 · Backend Development

Using Enums in PHP: Interfaces, Traits, Attributes, and Best Practices

This article explains PHP enums, showing how they improve code readability and safety, and demonstrates their integration with interfaces, traits, attributes, validation rules, casting, and matching mechanisms, providing practical examples and best‑practice recommendations for backend developers.

AttributeBest PracticesPHP
0 likes · 7 min read
Using Enums in PHP: Interfaces, Traits, Attributes, and Best Practices
php中文网 Courses
php中文网 Courses
Feb 6, 2024 · Backend Development

Method‑Based Model Casting in Laravel 11

Laravel 11 introduces a method‑based model casting system that replaces the traditional $casts property, allowing developers to define type conversions via Attribute methods, which improves code clarity, flexibility, testability, and overall maintainability of Eloquent models.

AttributeBackend DevelopmentEloquent
0 likes · 7 min read
Method‑Based Model Casting in Laravel 11