Refactoring my Laravel Project
Published on
My website has been on Laravel for a while and it has grown a lot over the last year. There weren't (m)any tests nor did the codebase have any static analysis or code style restrictions. Whi…
Published on
My website has been on Laravel for a while and it has grown a lot over the last year. There weren't (m)any tests nor did the codebase have any static analysis or code style restrictions. Whi…
Published on
In a recent project, I wanted to add some string helper methods. Laravel already provides a long list of string helper methods but they didn't cover what I wanted. These string methods can a…
Published on
Composer is the tool PHP developers use to manage their dependencies. Most of the time a composer.json is set up at the start of a project and then forgotten about. I often run the composer…
Published on
There have been many times when I was building a Laravel View Component and only wanted to render the HTML based on some logic. In the past, I added a Blade @if block to the actual component…
Published on
In a previous blog post, I wrote how I build traits for using in Laravel. This post discusses how you can use the trait in your Eloquent models. It covers how you actually use them, using th…
Published on
When adding functionality that might be applied in multiple places, you might consider a way to reuse the code. You can either make all your classes extend a base class using inheritance or…
Published on
I am really happy with these trilogy triptych prints from Nick Chambers. They are titled “Time Travelling Dudes” and you can hopefully guess which characters the simplified lines are depicti…
Published on
It's a new year, so here is my January movie review. Overall, I watched 24 new movies this month and every movie was released in 2022. I caught up on some fantastic movies and some hard-hitt…
Published on
I have previously been writing custom Laravel validation rules with explicit passes() and message() methods. However, since Laravel 9, the preferred method is now a little different. The doc…
Published on
I wanted to add an item to a Laravel Collection, based on a truthy condition. In the script, I quickly jumped for the basic if syntax, but then wondered if there was a nicer way. if ($condit…