Writing on software engineering, mostly tutorials.

I write a lot of tutorials, in the aims that others can learn from my experience. It is also a great way to document how you approach common problems, so that you have a point of reference.

Some of these are links through to Laravel News where they are articles that I have written there.

Laravel Response Classes

Responding from your Laravel application is vital, especially when you are building an API. Let's have a look at how we can power up our responses.

Laravel CI with GitHub Actions

GitHub Actions is a fantastic way to run your Continuous Integration workflows, from running your tests to checking static analysis and more.

Managing Routes in a large Laravel Application

Laravels routes files can get pretty busy. Before you know it, you have to search within the routes file to find anything. How do you combat this, though?

Getting started with PHPInsights

PHPInsights is a composer package created by Nuno Maduro and is a fantastic tool to get started with analyzing the code quality of your PHP applications.

Laravel Pennant

Laravel Pennant is a package created by the Laravel team that provides Feature Flags for your applications..

Testing JSON:API Endpoints with PestPHP

JSON:API provides many options for filtering, sorting, and including extra data into the requested data using query parameters. Testing this can be frustrating.

Building APIs in Laravel

Building APIs in Laravel is an art form. You must think beyond data access and wrapping your Eloquent Models in API endpoints.

Reducing code duplication

Code duplication is the most painful thing for a lot of developers, you think you have solved the problem, but there are several instances of the same issue.

Configuring Laravel Pint

Laravel Pint is the hot new thing from the Laravel team. An excellent wrapper around PHP CS Fixer that is my go-to code standards tool.

Using OpenAI in Laravel

AI is it a buzzword, or is it something we should be thinking about? With the release of the OpenAI package, we can dive into AI-powered Laravel applications.

Effective Eloquent

Get ready to level up your Laravel skills with this tutorial on eloquent queries! You'll learn everything you need to know, from beginner to advanced techniques.

Eloquent API Calls

Time and again, I have spoken about API integrations, and each time I find an improvement from the last, once more into the fray.

Using DTOs to keep context

DTOs, or Data Transfer Objects, can be used for so much. Since PHP 8 was released, creating these fantastic classes in your projects has never been easier.

Creating a Password Generator

Password generation is something we all think about doing at some point, but how can we go about doing it and making these passwords easy to remember and secure.

Fun with Refactoring

Refactoring isn't a dirty word, quite the opposite. Refactoring is something that you do when you have leveled up or generally improved.

Your first Laravel 9 Application

If you have never built a Laravel application, let me take a walk-through with you from scratch - with no perceived knowledge. Follow along to learn Laravel.

Valid validators validating data

Validation is a must-have for any modern project, and in Laravel, it is super simple to get started. Let's talk about the different ways we can handle it.

Composition over inheritance in final classes

Final classes, you either love them or hate them. People have been using them more recently in their open-source packages, but what does that mean for you?

Reaching for Facades

Facades, people seem to love them or hate them. Either way, they are a natural part of what Laravel is today. Laravel Facades aren't strictly facades, are they?

Modern PHP features explained - PHP 8.0 and 8.1

Since its release, PHP 8 has been a game changer. In this tutorial, let's walk through all the latest features with real-world examples of when to use them.

Automating your OpenAPI Documentation

Over the years, as developers, we have always looked for ways that we can automate our documentation, from PHPDoc to Swagger and beyond.

Learn how to upload files in Laravel like a Pro

One of the things that I see many people struggling with is file uploads. How do we upload a file in Laravel? What is the best way to upload a file?

Diving into Notifications

In most applications, we need to send notifications, whether in-app, email or slack these are transactional notifications in your application. Let's take a dive.

Writing to the Database with Eloquent

Eloquent is one of the most powerful and amazing features in a modern framework today. From casting data to value objects, transactions, and relationships.

Simple one-time password authentication in Laravel

When dealing with Authentication in Laravel, there are several options out of the box. However, sometimes you need something more specific. This tutorial will look at how we can add a one-time password approach to our authentication flow.

Setting up your Data Model in Laravel

The data model is one of the most important parts of any Laravel application, many systems are designed around this data model so we approach it first.

Behavioural Driven Development in Laravel

BDD or Behavioural Driven Development is a popular testing approach in many organizations and has a proven track record for uniting testing efforts in teams.

Working with OS process in PHP

Sometimes you need to work with OS-level commands from your PHP application. Let's look at how we can do this and see if we can make the DX nicer.

Working with Laravel Model Events

When working with Eloquent Models, it is common to tap into the events dispatched through the Models lifecycle.

Event Sourcing in Laravel

Event Sourcing is a term that has been getting more popular in the PHP community over the last few years, but it still remains a mystery to many developers.

Zero Hassle CLI Application with Laravel Zero

How can I put this? CLI apps are cool. The ability to open a terminal anywhere and just run a command to do a job that might have taken you much longer.

How I develop applications with Laravel

I get asked a lot about how you work with Laravel. So in this tutorial, I will walk through my typical approach to building a Laravel application.

JSON API Resources in Laravel

Consistent API responses are important these days, and finding a standard is a great way to level up your approach. In this tutorial, we will look at JSON API.

Building your own Laravel Packages

Sharing code has never been more accessible, and installing PHP packages has become convenient, building packages not so much.

Using Laravel Model Factories in your tests

Laravel Model factories are one of the best features you can use in your application for testing. In this tutorial, we will look at how to use them.

Working with Data in your API Integrations

Working with third party APIs can be frustrating, we get plain old array - and we send data as arrays too. What if I told you it didn't have to be this way?

Running PHPStan on max with Laravel

As developers, the chance of you having a personal website is pretty high. After all, it is what we do - and most likely, you have rebuilt this countless times.

The State of Laravel Survey 2022

Laravel celebrated its 10th anniversary last year. Today it is the most popular PHP framework used by thousands of developers every day.

Eloquent Attribute Casting

Eloquent Castable attributes are one of the more powerful features of Laravel, some people use them religiously while others tend to shy away from them.

Laravel Pint

The long awaited hype train is finally over, Laravels latest open source CLI app has been released and we got our hands on it to tell you all about it.

Running PHPStan on max with Laravel

We have all needed to add some sort of search to our applications before, this tutorial will walk you through how you can use Laravel Scout and Meilisearch.

Running PHPStan on max with Laravel

Over the last few years static analysis in PHP, and more specifically Laravel, has become more and more popular. Follow this tutorial and start using it today

API Integrations using Saloon in Laravel

We have all been there, we want to integrate with a 3rd party API in Laravel and we ask ourselves "How should I do this?", is Saloon the right choice for you?

Laravel subdomains in Docker

There are many ways you can add Docker to your Laravel application, but how do you add docker to your Laravel application when you need sub domain support?

Sauber PHP

I have used a lot of different frameworks in my career, from Zend(Laminas) to Yii, Cake to Codeignitor, SlimPHP to Laravel and more. They all have their own way of doing things, and their own selling points and benefits. Some are strict on their PSR (PHP Standards Recommendation) implementation, while others are a little looser. I have also always wanted to dabble with creating my own micro-framework, one that I can use for small APIs that just need something fast thrown together.

Building a CLI application in 2022

I have been building CLI apps for a long time, from simple bash/perl scripts back when I was a System Admin - and now using things like PHP Go or Rust. Let's walk through options for building CLI apps in 2022

Laravel Command Bus

In Laravel 5.1 the Command Bus was replaced with Dispatchable Jobs, we can still use them but let us also look at how to add a Command Bus.

Adapter Pattern

Over the years I have built a lot of SDKs to work with 3rd party APIs. Each time I require the same components, so I decided to create a way to bootstrap this process while still allowing flexibility

Testing API responses in pestPHP

I get asked about API response testing a lot, how should you do it, and where to start. I have a general rule when it comes to testing APIs, and that rule is: "test your code, and your code only". What do I mean by this? Let me explain.

Tappable Query Scopes in Laravel

I recently saw an awesome tweet while browsing twitter which introduced this idea of tappable query scopes, and wanted to share it and dig into it a little more.

Laravel DDD - Routing within our Domain

In a normal Laravel application we store all of our routes within web.php or api.php typically, however how does this work with our Domain Driven Design approach? Do we create a routes/{domain}.php file, or do we want to put this somewhere else?

Laravel DDD - Querying Records in our Domain

In the last instalment we spoke about using a simplified version of the CQRS pattern to create commands. This time we are going to talk about the other side to this and talk about queries.

Laravel DDD - Using Data Objects; Domain Commands

In our last instalment we spoke about how we can use data objects and data object factories to escape what I call “array hell”, a place where we have no idea what is in something passed to a method and there is no context or strictness about them. Now that we know how we are going to create these let’s look at a way we can use them!

Laravel DDD - Getting started with DDD in Laravel

In a typical Laravel application we are very used to doing things in a certain way, by the book as they say. However there comes a point in the applications lifetime that it is going to be easier to start looking to split this code into Domains so that we can logically group our code.

Working with third party services in Laravel

There are many ways to work with 3rd party services in Laravel, here is how I do it. I will walk through setting up a service to connect to the PingPing service

Adventures in PHP - PHP SDK Builder

Over the years I have built a lot of SDKs to work with 3rd party APIs. Each time I require the same components, so I decided to create a way to bootstrap this process while still allowing flexibility

Adventures in PHP - PHP URI Builder

In PHP you can easily build a URL by concatenating strings, and iterate that process nicely. However, I hate this approach. It doesn't feel true to OOP, and it definitely isn't testable

PHP Online - The Story So Far

I have been working on community projects now for the past 3-4 years, and in that time I have noticed something. PHP Online is my answer to what I think the community needs.

Building a REST API in GoLang - Part 1

I have been building APIs for production environments for many years now, predominently in PHP. The last 3 years however, I have been hard at work getting to grips with GoLang - so I thought I would change the pace and share a post on GoLang

My First Go Module - go api problem

Recently I have been playing with GoLang quite a lot, so I decided to try my hand at publishing my first Go Module to handle errors nicely in an API.

Embracing The Tall Stack with Event Sourcing, an adventure into the unknown

TALL stack is growing in popularity in the Laravel community, and rightly so. The way in which you can write beautiful code split into reactive components without ever having to leave PHP is a no brainer. Recently the TALL stack preset was released, which on its own is fantastic - but I wanted to take it one step further.

Embracing PSRs to build an interoperable Http Client

Recently I have been scratching my head over PSR-18. As a new PSR there isn't a lot of information around it, but I saw that as a challenge. I decided to accept this challenge and build a compliant HTTP client to embrace the future of interoperability.

An adventure with Graph Databases

Recently I have been super interested in graph databases, most specifically neo4j. However, there was no official packages for PHP that were still active. I decided to change that.

Slim4 - A lightweight breath of fresh air

As a PHP developer I use Laravel quite heavily, but I have been a long time user of SlimPHP. The latest version of Slim has inspired me to use it more often.

New Blog

New year new blog, concentrating on my personal blog.