Everything on PHP.
27 articles tagged PHP, sorted newest first.
PHP 8.4 Lazy Objects: Defer Expensive Initialization in Laravel
You inject a heavy service into a controller, the container builds it on every request, and half your routes never touch it. PHP 8.4 lazy objects let you defer that cost until the object is actually used.
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 8.5 Asymmetric Visibility for Static Properties
PHP 8.5 finishes what 8.4 started: asymmetric visibility now applies to static properties. Read freely, write only from inside: and ditch the static getter boilerplate for good.
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.
Rector PHP: Automate Laravel Upgrade Refactors
Stop hand-editing hundreds of files when bumping PHP or Laravel versions. Here's how to wire Rector into a Laravel project, run it safely, and write a custom rule for the patterns specific to your codebase.
PHP Enum Methods and Interfaces: Beyond Basic Backed Enums
Most devs use PHP enums as glorified string constants. They can implement interfaces, carry methods, and replace entire class hierarchies: here's how.
PHP 8.5 Deprecations Cheat Sheet: What to Fix Before Upgrading
PHP 8.5 ships with a batch of deprecations that will become hard errors in PHP 9.0. Here's the complete list with one-line fixes and a Rector command to automate the scan.
PHPStan Level 10 in Laravel: Fix the 5 Most Common Errors
Bumped Larastan to level 10 and got 300 new errors? Here are the five patterns you'll see again and again: and the exact fix for each.
PHP 8.5 array_first and array_last: Clean Up Your Collection Fallbacks
PHP 8.5 adds two long-overdue functions that eliminate the awkward workarounds for accessing the first or last element of an array.
Laravel 13 PHP Attributes: Cleaner Models, Jobs, and Commands
Laravel 13 ships opt-in PHP attribute syntax across 36+ framework locations. Here's what changed for models, jobs, and Artisan commands: with zero migration required.
Dockerising Your Laravel App for Kubernetes: From Dockerfile to Running Pod
Take a Laravel app from Docker Compose to a running Kubernetes pod: covering the production Dockerfile, Nginx+PHP-FPM setup, and the K8s manifests you actually need.
Stop Using parse_url(): PHP 8.5's URI Extension Explained
PHP 8.5 ships a built-in URI extension that replaces parse_url() with immutable, type-safe objects. No third-party package needed.
PHP 8.5 clone with: Updating Readonly Objects Without Boilerplate
PHP 8.5 lets you pass an array to clone() to update properties in one expression. Here's how it replaces wither method boilerplate: and the gotchas you need to know first.
PHP 8.5 Pipe Operator: Clean Function Chaining in One Line
PHP 8.5's |> operator lets you chain functions left-to-right instead of nesting them inside-out. Here's how it works and where it breaks down.
Optimising Laravel Docker images with multi-stage builds
A single-stage Dockerfile for Laravel ends up with 800 MB+ images full of build tools you don't need in production. Multi-stage builds fix that: here's how.
Replacing String Constants with PHP Backed Enums in Laravel Models
String constants like STATUS_PENDING are typo-prone, unautocompleted, and impossible to enumerate exhaustively. PHP backed enums fix all of that: and Laravel has native support throughout.
PHP Readonly Classes as Value Objects in Laravel
Primitive obsession is one of those code smells that's easy to ignore: until you're debugging which integer is pounds and which is pence. PHP readonly classes fix that cleanly.
Upgrading from Livewire 3 to Livewire 4: A Practical Migration Guide
Livewire 4 shipped in early 2026 with SFCs, smarter wire:model, and a leaner Volt story. Here's how to upgrade a real app without surprises.
PHP 8.4 Fibers: Async Patterns Without a Framework
PHP has had Fibers since 8.1, and PHP 8.4 quietly improved them. You don't need ReactPHP or Amp to get useful concurrency patterns: here's what Fibers actually give you and when to reach for them.
Enforcing Laravel architecture rules with Pest's arch() helper
Pest's arch() helper lets you write rules that enforce your app's structure at test time: no more accidentally importing Eloquent into a controller.
Verifying Stripe webhook signatures in Laravel without Cashier
You don't need Laravel Cashier to verify Stripe webhook signatures. Here's the minimal setup using the Stripe PHP SDK directly in a controller.
The Complete Laravel Developer Toolchain for 2026
Stop spending days configuring tools. Here is every tool in my Laravel stack for 2026, why I chose each one, and exactly how to set it up.
Running Laravel Pint Automatically with Git Pre-Commit Hooks
CI failing because someone forgot to run Pint again. Here's how to wire up a Git pre-commit hook so it never slips through.
PHP 8.4 Property Hooks in Laravel Models
PHP 8.4 property hooks are a tidy language-level alternative to getters and setters: but before you reach for them in your Eloquent models, there's a catch worth understanding.
How to audit PHP dependencies (practical guide)
How to audit PHP Composer dependencies for security, license and maintenance issues, with tools and a small script you can run today.
Streamlining Laravel Developer Onboarding with a Makefile and Herd Pro
Speed up Laravel onboarding with a powerful Makefile. Automate Herd Pro setup, install dependencies, and seed databases for a consistent, one-command setup experience.