Enums, Beta Releases & White Screens—Oh My! Your Weekly PHP Adventure
This week, we’re cleaning up our code by tackling unruly Laravel controllers and figuring out the right time to use PHP Enums. Plus, we’ll cover session security, Composer best practices, and the late
As we head into September, the post-summer push is in full swing here at the office. The other day, during a pull request review for a new transaction ledger feature, I came across a controller that was doing… everything. It was fetching data, transforming it in five different ways, handling complex business logic, and then cramming a messy array into the view. It was a stark reminder of how easily things can get out of hand without clear architectural patterns.
It’s a classic problem, and it’s why the article on stopping bad controllers with Laravel’s custom collections immediately caught my eye. It’s a fantastic read on abstracting that logic away into a much cleaner, reusable format. On a similar note of enforcing structure, we also have a great piece on a more fundamental topic: when to use PHP Enums. It’s a feature that looks simple, but using it correctly can really make your domain logic clearer and prevent a whole class of bugs.
From fundamental best practices to the latest beta release of PHP 8.5, there’s plenty to dig into this week to sharpen your skills. Let’s get to it.
PHP
PHP Enum are meant to define a set of possible values. While it may look like a classic PHP class, it’s a special data type, and the idea is to enforce strong type for a specific usage.
What Happens If Attacker Gets Session ID?
📚 Service Responses | From Chaos to Clean APIs
I used to build backend services the “quick way.” Every function returned something different: sometimes arrays, sometimes strings, sometimes just a boolean. Clients never knew what to expect. Debugging? Nightmare. Error handling? Confusing.
📚 How I Fixed the WordPress White Screen of Death by Increasing PHP Memory
If you’ve ever woken up to find your WordPress site showing nothing but a blank white page, you’ll understand the panic I felt when it happened to me.
📚 25 PHP Shortcuts for the Modern Code Wizard (Part 2/3)
This is Part 2 of a three-part series that teaches modern PHP shortcuts and patterns that make code safer, faster, and easier to maintain.
📚 WP Webhooks: The Ultimate Guide to Connecting WordPress to Anything (2025)
This ultimate guide will not only teach you everything you need to know about WP Webhooks but also provide a clear, actionable solution to this local development problem using Tunnelmole, a simple and open-source tunneling tool.
📚 What is n8n? A Complete Beginner’s Guide to Workflow Automation
In today’s blog post, we will explore what n8n is and how we can automate our day-to-day tasks by automating these Workflows.
📚 PHP 8.5.0 Beta 2 available for testing
The PHP team is pleased to announce the second beta release of PHP 8.5.0, Beta 2. This continues the PHP 8.5 release cycle, the rough outline of which is specified in the PHP Wiki.
📚 PHP 8.3.25 & PHP 8.4.12 Released!
The PHP development team announces the immediate availability of PHP 8.3.25 & PHP 8.4.12. This is a bug fix release. All PHP users are encouraged to upgrade to this version.
📚 Composer Install or Update? Best Practices for Safely Updating Composer in Production
This post walks you through how to safely update Composer dependencies, explains why composer update should never be used on production, and outlines the right way to manage frequent package upgrades.
📚 Autoloading and PSR-4 Explained in Simple Terms
When working with PHP projects, especially as they grow larger, you don’t want to manually include every single class file with require or include. That’s where autoloading comes in.
Laravel
📚 Avoid the Mess: Structuring Laravel View Data with ViewModels
When working with .NET Framework MVC applications, I used to use bound view models, which let me use classes on the Razor templates very easily with the autocomplete feature.
📚 Stop Writing Bad Controllers: Laravel Custom Collections Transform Your Code
We’ve all written that controller – you know, the one with 15+ lines of business calculations that you’ve copied to three different places. Yeah, that one.
📚 Enhanced Queue Job Control with Laravel’s ThrottlesExceptions failWhen() Method
Laravel’s ThrottlesExceptions middleware recently gained a valuable enhancement with the introduction of the failWhen() method. This addition provides developers with precise control over job failure behavior, particularly beneficial for managing job chain execution flow.
📚 Building Powerful AI Tools with Laravel: A Complete Guide to MCP Integration
Today, I’ll show you how to build a comprehensive MCP server with Laravel that exposes tools, resources, and validation utilities to AI assistants.
📚 How to Build a Simple Notebook App with Laravel & Filament v4 (Step-by-Step Guide)
This guide walks you through building a minimal Notebook application using Filament v4. We’ll use Filament’s Panel and Resources to scaffold a CRUD system for quickly managing notes.
📚 Laravel Request Lifecycle Explained (Beginner-Friendly Guide)
Have you ever wondered what really happens when you type a URL in your browser and hit enter in a Laravel application?
📚 Laracon AU 2025 Talk Titles Revealed
The Laracon AU 2025 schedule is now live, with the full list of talk titles published today at laracon.au/schedule.
📚 Heartbeat Collection Method in Laravel 12.26; Wayfinder Now in React and Vue Starter Kits
The Laravel team released version 12.26.0 this week, adding a withHeartbeat() method to Lazy collections, a toPrettyJson() method to collections, models, and more. Additionally, the Laravel Vue and React starter kits include Wayfinder, which bridges type-safe routes between Laravel and your frontend.
📚 Caching Strategies and Optimization in Laravel
In today’s fast-paced digital world, speed is everything. Whether you’re building a fintech platform, an e-commerce store, or a social app, users expect instant responses. But as your application grows, database queries and heavy computations can slow things down.
📚 Laravel & Design Patterns — Practice Series: Facade
In this article, we are going to take a look at how to practically implement the most used patterns in Laravel — the Facade pattern. So, as always, let’s begin with a definition.
📚 Laravel’s Fluent Object Helpers
In Laravel 12, several of these helpers have been supercharged with new capabilities, making them even more powerful for performing fluent, object-oriented operations on your data.
📚 Optimizing MySQL Queries in Laravel: Tips for Faster Applications
Every web application relies on the database. No matter how elegant your Laravel code is, slow database queries can make your app feel sluggish and unprofessional.
📚 Mastering Adapter Pattern in Laravel: Building Modular Applications
When building modular applications in Laravel, one common challenge is how to let different modules interact without creating tight coupling.
📚 Log Handler Bubbling in Laravel
Log handler bubbling, when using a stack of handlers, allows you to control if the logger should continue going through the remaining handlers and checking if it can log to them, based on the log level.
Symfony
So, in my previous article I talked about why I decided to switch from Auth0 to Symfony as my authentication provider. In that article I also promised to write a follow up guide on how I actually implemented it.
📚 Implement Multi Tenant Architecture in Symfony
In this comprehensive guide, we’ll explore how to implement multi-tenancy in Symfony applications.
Symfony 7.3.3 has just been released. Read the Symfony upgrade guide to learn more about upgrading Symfony and use the SymfonyInsight upgrade reports to detect the code you will need to change in your project.