All Posts

Access the Model Inside a Form Request

Laravel’s form requests really help reduce the amount of code in your controllers, especially around validation. Another convenience method they offer is authorization. I recently came across a small tip which isn’t explicitly stated in the docs and thought I’d share it.

Toggling Groups of Related Fields in Update Request

Let’s say you have a form with two groups of related, but mutually exclusive, fields. When you POST and store a new record, no problem, only the right fields are sent in. But what do you do when that record is updated? How can you cleanly handle this?

Understanding Dot Notation in Laravel Validation

Laravel validation supports “dot notation” to let you validate arrays in a request. But what if your field name contains a literal dot?

Why I Switched to Fathom Analytics

Google Analytics is free and has every imaginable feature you might ever want. So why would I switch to paying for Fathom Analytics?

Why I Enjoy Working on Legacy Software Applications

Today I realized something about myself, I actually really enjoy working in legacy applications. This may seem odd. It’s common to hear complaints about “how bad this old code is”, so why would I enjoy working in a difficult environment? First, it would be useful for me to define what makes an application a legacy application. I realize this may not be a universal definition for everyone, but here are the core elements I think of that make an application qualify as “legacy”:

Use Randomness Intentionally in Testing

Randomness can serve a useful purpose in factories, seeders, and tests. There are times it can cause issues though. Here are some rules I think about when introducing randomness into a test.

When You Might Want to Rebase a Feature Branch

Is git rebase a command to be avoided at all cost? I say no. Here’s one use case where I reach for rebase instead of merge.

Repeat Last Argument at Command Line

Here’s a handy tip when you want to rename a file with a long path/name and don’t want to retype it twice.

What Are Your Important Tasks Today?

Many of us have a seemingly endless backlog of tasks we could be doing. How can you figure out what’s most important, and use that decision to bring focus to your day?

Benefits of Keeping a Work Journal

Many developers feel overwhelmed with the amount of work they want to get done each day. Or they feel pulled in multiple directions and struggle to make progress on the important things. I can totally relate! One thing that helped me is keeping a work journal.