Skip to content

Blog

Page 7 of 76 - keep going...

PhpStorm Docker Not Starting Fix

Recently, I had an issue with PhpStorm not detecting my Docker configuration. I was using Docker Compose and everything worked fine with docker cli and Orbstack. Why wouldn’t PhpStorm recognize this? It’s a simple fix, actually. It has to do with the name of your project. Let me explain.

May 31, 2025 2 min read #docker #phpstorm

Quick PHP REPL

A REPL (Read-Eval-Print-Loop) is useful in a lot of cases. It allows you to run your code in this specific environment in a way that can be particularly useful with debugging.

So, what if you need a REPL in PHP but you don’t have Laravel Tinker available (yet?).

Mar 27, 2025 1 min read #php

Naming things is suddenly easier

Oh that famous computer science joke: there are two hard problems in programming, cache invalidation, naming things and off-by-1 errors.

But, on a recent Laravel project, I realized something super important. Let me show you what I was doing and see if you can follow along.

Mar 26, 2025 2 min read #laravel #programming

Using Eloquent's when method cleans up code

Laravel gives a lot of syntactical sugar helpers. This allows you to write your Laravel code in a few different flavors or dialects. Some programmers prefer using fluent interfaces, others composition, and others pure functional statements.

As a seasoned and salty programmer, I tend to stick with what I know. It can be easy to overlook the helpers that Laravel provides. But, with Eloquent, the when function is way more useful than a simple helper. The true eloquence comes from its handling of the results of the first condition check.

Mar 25, 2025 2 min read #laravel

How I Launch a Laravel Testbed

Sometimes I need to spin up a quick Laravel instance on my Mac to test something out. With just a couple keystrokes, I can get a brand new Laravel instance running in a Docker container, ready for my IDE and testing. Here’s how.

Jan 16, 2025 2 min read #laravel

What is the best framework for a super small task?

“If you only have a hammer, everything is viewed as a nail” is an idiom referred to as Maslow’s hammer. It basically means that if you only know one tool, and you over-rely on it, you’ll only use that tool to solve every problem, regardless of whether it’s the right one for the job. (It’s a common saying around these parts… that and Joel’s famous saying “Do you even have a 5th bathroom if the floor isn’t heated?”)

Laravel is quite the Swiss Army Knife - it has easy solutions for just about every problem and task you have. That’s why I’m such a fan of it. But is it always the right tool for the job?

Oct 22, 2024 2 min read #laravel #php #programming