All entries of my technical and business blog

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.

Why You Might Want to Hydrate Models to Delete Them in Laravel

Oct 15, 2025 laravel

There are many ways to handle cascading functionality in Laravel. You can do this with observers, events, manually dispatched jobs - even in MySQL with cascading deletes.

I prefer to keep my cascading logic in the application code by using Eloquent Model Events. This is super easy when it’s just a single level of model. But what about relationships?

Reusing DotEnv Configuration with the Shell

Sep 29, 2025 php scripting

A common security pattern is to add environment-specific configuration and secrets into a local, unversioned file. You’re probably already doing this with a tool called DotEnv. Let’s see how we can reuse that between PHP and the shell.

Livewire 3 Reactive Event Dispatching

Sep 9, 2025 laravel

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.