All entries of my technical and business blog

Use PHP Named Parameters for Readability

Apr 21, 2026 php

Having too many parameters for a method signature is a sign of a method that is doing too much. But, what can be done to make this more readable if you’re forced to stick with it? Let’s see an example using named parameters.

Laravel 201 Created JSON With Location Header

Mar 12, 2026 laravel

Each API seems to be different. However, there are some best practices that we should all try to follow.

One of those that I really like is the 201 Created HTTP response. If the object is created immediately, you may even return the full object contents.

In some cases, we don’t have the data or don’t want to return the full payload. We can return null with a location header. Here’s how to do that with Laravel.

Fixing PHPStorm when Git Stops Responding

Feb 26, 2026 git macos phpstorm

PHPStorm suddenly stopped recognizing my git repository. I cleared the cache, restarted the IDE, but nothing helped. I jumped to my terminal, ran git from the command line, and everything worked fine there. Confusing, right?

Let me explain why this happened and how I fixed it for good.

Why Im Not Writing About AI Yet

Feb 18, 2026 programming

AI is everywhere - and it has been for the last months… the last year(s)… I even use it now a lot as a tool for my development. So why haven’t I published AI guidance or written about it at all?

It’s really a simple reason. And it’s not what you think probably. I’m not a hater. It’s extreme love of AI and technology that makes me wait. Let me explain.

Customize Laravel Ide Helper to Autocomplete Blade Files

Dec 17, 2025 laravel phpstorm

I’m working with Yajra DataTables in a Laravel project and I’ve ran into a little bit of a headache. They provide their own render() method, which you pass a blade file to as the first parameter. Something like users.dogs.index - and through that mechanism it loads the proper blade for the datatable.

Here’s the problem, though. I can’t get auto complete and I can’t click through on that in PHPStorm. But I want to. Let’s find out how.

Phpstorm Terminal LC_ALL Error Fix

Dec 5, 2025 macos phpstorm scripting

When a new terminal opens in PHPStorm on macOS, I was getting a weird error: bash: warning: setlocale: LC_ALL: cannot change locale (en_US-u-hc-h12-u-ca-gregory-u-nu-latn): Invalid argument.. Strange, I use Oh My Zsh with the Zsh shell. Why am I getting that error? Why bash? I could ignore it each time - but I wanted a fix.

Github Workflow for Production Merge

Nov 18, 2025 git github

Github actions are awesome. In fact, we often write about them or share details on MasteringLaravel.io in the tips section or the community.

Let’s take a look at one particular workflow that appears pretty simple - after you understand it all.

How do we merge from develop into main for a production deploy or merge? By using this Github action.

Stopping Laravel SQL Injection with sole()

Nov 7, 2025 laravel mysql security sql

I love using Eloquent’s sole() method in Laravel. It throws an exception if the result set is ever more than 1. It means you should only have a sole record. This is usually what I want. I’ve migrated away from firstOrFail() unless I legitimately want the first of a matching set.

But I just found another reason to love using the sole method - it helps add a layer of protection against SQL injection. Let’s find out how.

A Deep Dive Into Print Css Headers and Footers

Oct 23, 2025 css html

For a project I’m working on, I had to become very familiar with the print CSS styles for headers and footers. The goal is two fold: 1) to have a nice printable version and 2) to use a chrome-pdf tool to download as PDF.

Regardless of the two consuming sources, I just wanted to solve this all as one html/css file. So, it was necessary to explore all of the different options we have now, in 2025, on Chrome.

In this blog entry, see print (pdf) versions of the different header/footer functionality in CSS including built-in page margin and header/footer tools as well as fixed/forced hacks.