Everything on attributes.
3 articles tagged attributes, sorted newest first.
Deprecate Your Own Code with PHP 8.4's #[\Deprecated] Attribute
PHP 8.4's #[\Deprecated] attribute turns invisible docblock deprecations into real runtime warnings that reflection and static analysis can see. Here's how to use it in a Laravel package.
PHP 8.5 #[\NoDiscard]: Stop Silently Ignoring Return Values That Matter
PHP 8.5 ships a new #[\NoDiscard] attribute that warns when you forget to use a function's return value. Here is how to apply it to your own immutable builders — and why (void) is the only safe way to suppress it.
PHP Custom Attributes in Practice: Beyond Laravel's Built-ins
Laravel 13 ships dozens of built-in PHP attributes, but the docs are quiet on building your own. Here are the patterns I use in production for validation, auth, and auto-discovery.