Modelling Busines Processes in Laravel
As developers, we often map business processes to digital processes, from sending an email to something quite complex. Let's look at how we can clean this up.
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.
As developers, we often map business processes to digital processes, from sending an email to something quite complex. Let's look at how we can clean this up.
Sometimes we don't want users to have passwords. Sometimes we want to send a magic link to a user's email address and have them click to gain access.
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.
GitHub Actions is a fantastic way to run your Continuous Integration workflows, from running your tests to checking static analysis and more.
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?
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 is a package created by the Laravel team that provides Feature Flags for your applications..
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 is an art form. You must think beyond data access and wrapping your Eloquent Models in API endpoints.
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.
Laravel has a fantastic DI container, yet many people shy away from it. In this tutorial, I will walk through how I lean on Laravels container.
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.
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.
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.
It's common to see two programmers who code the same feature differently. It's much less common for those two programmers to see eye-to-eye and remain friendly
Time and again, I have spoken about API integrations, and each time I find an improvement from the last, once more into the fray.
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.
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.
Refactoring isn't a dirty word, quite the opposite. Refactoring is something that you do when you have leveled up or generally improved.
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.
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.
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?
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?
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.
Over the years, as developers, we have always looked for ways that we can automate our documentation, from PHPDoc to Swagger and beyond.
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?
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.
I have been a fan of Laravel Livewire since it was first released, and I have used it many times to create great user interfaces for applications.
Eloquent is one of the most powerful and amazing features in a modern framework today. From casting data to value objects, transactions, and relationships.
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.
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.
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.
Content management is a very opinionated topic, and everyone has their favorite platform they like to use.
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.
When working with Eloquent Models, it is common to tap into the events dispatched through the Models lifecycle.
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.
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.
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.
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.
Sharing code has never been more accessible, and installing PHP packages has become convenient, building packages not so much.
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 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?
Recently I came across a unique approach to loading routes into Laravel applications, and I wanted to share this amazing idea with you.
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.
Laravel celebrated its 10th anniversary last year. Today it is the most popular PHP framework used by thousands of developers every day.
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.
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.
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.
The biggest issue with working with third-party APIs is that we have very little visibility. We integrate them into our code base and test them.
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
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?
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?
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.
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
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.
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
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.
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.
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?
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.
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.
This article is taking that next step, creating our domain code. We will being this part of the journey by creating data objects and data object factories. But before that, let's talk about what these are, and why we would use them.
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!
Lets have a quick look into my latest package Laravel Feature Flags.
Introducing Laravel Transporter, an object oriented way to send API requests 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
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
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
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.
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
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.
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.
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.
Introducing my latest PHP Package: ParamterBag - A flexible parameter bag in place of standard arrays on PHP classes.
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.
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.