PHP Docker for Dev

I’m staring a new PHP project and I wanted a clean docker image to work from.
I inherited one on my last project and wanted to improve image size, security and production alignment.
A Web Developer’s Blog

I’m staring a new PHP project and I wanted a clean docker image to work from.
I inherited one on my last project and wanted to improve image size, security and production alignment.

It’s amazing being able to get free TLS certificates instantly from Let’s Encrypt.
But they don’t provide certificates for localhost
You can generate, and trust, your own certificates and I’ve written up how to do that but honestly it’s not a trivial process.
Here is how to use Let’s Encrypt for local dev.

Laravel’s database migrations is a great system and makes it easy for the development team to stay in sync with schema changes as well as ensuring tests can run against a defined database state.
It also makes great use of transactions to efficiently roll back changes after each test
But what if you have some large tables of fairly static data that you don’t want to reload on every test run …

I have been working with some of the data from The Office of National Statistics and Ordnance Survey.
If you want some lookup tables to find out how wards, districts/divisions, counties and so on all relate take a look here

Something didn’t quite click with me about Laravel Eloquent Models.
There is nothing in the Model that defines the fields.
The Model defines which database table the data is stored in.
Whatever fields are in the table will be loaded to the Model.

I wanted to better understand what is happening when I run Laravel tests that hit the database.
TLDR: Database migrations are run on every test run, optionally with seed data.
Each test case runs in a transaction.
(This is written based on Laravel 9)

I have been blogging since about 2005 and been through several different platforms in the process
Using a Static Site Generator with content in Markdown is awesome for low maintenance and content portability.
If I move platform it shouldn’t be hard to migrate the content and to that end I want to keep the my posts fairly pure Markdown - but it can be a bit limited.
How do I add some classes to change how it looks?

How to find out what version of Laravel you have.
The difference between a laravel-framework update and a laravel skeleton update.
What is Laravel skeleton anyway ?
How to control when you get updates.
Laravel’s routing and binding is nice
But when I got it wrong I didn’t get the kind of error I expected
Laravel automatically resolves Eloquent models defined in routes or controller actions whose type-hinted variable names match a route segment name.
use App\Models\User;
Route::get('/users/{user}', function (User $user) {
return $user->email;
});

I’m working on a PHP project and code review brought up some formatting issues in my CSS.
I wanted to added automated formatting of these files accessible to everyone in the team without them having to install node as this isn’t a JavaScript project.
We already use Docker so that seemed an obvious choice.