Skip to content

Blog

Page 7 of 77 - keep going...

Livewire 3 Reactive Event Dispatching

Issuing events with Livewire is a useful way to communicate between components. But, there are some caveats to be aware of - especially if you’re coming from something like React or Vue. The majority of this comes from the fact that Livewire treats every component as an island.

This had stumped me a few times in the past. Because of this, I wanted to give a quick example of how you can use Livewire events in a way that you might be more familiar with: with reactivity.

Sep 9, 2025 3 min read #laravel

Showing UTC in the Users Timezone Easily

In most of my applications, time is reflected in the UTC timezone. This is great for logic and math, but not so great when showing the date to the regular user.

Now, it’s pretty easy to show the UTC dates in the user’s timezone, without even asking them what it is.

Let’s see how to do this with a little bit of HTML and Javascript.

Jun 18, 2025 3 min read #html #javascript

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