PSR-20 Clocks: Testable Time in PHP
– doeken.org - submitted by Doeke Norg
Learn how a ClockInterface helps you decouple time and write stable, testable code. It's about time!
Read more [doeken.org]
– doeken.org - submitted by Doeke Norg
Learn how a ClockInterface helps you decouple time and write stable, testable code. It's about time!
Read more [doeken.org]
This is a great way of handling config values.
Read more [cosmastech.com]
Join 9,500+ smart developers
Get my monthly newsletter with what I learn from running Spatie, building Oh Dear, and maintaining 300+ open source packages. Practical takes on Laravel, PHP, and AI that you can actually use.
No spam. Unsubscribe anytime. You can also follow me on X.
"Freek’s newsletter is one of the best ways to stay updated with the Laravel and PHP ecosystem. It consistently highlights useful packages, tools, and ideas from the community, especially the amazing work coming from Spatie. As a Laravel developer building SaaS and web platforms, I find it extremely helpful to discover practical tools and insights that improve my development workflow."
Some teams require that every TODO comment in a codebase gets logged in the bug tracker. Others automatically delete any “stale” TODO that has been in the codebase for over a year. Don’t do it!
Read more [sophiebits.com]
Every once in a while, someone opens a PR on one of our open source packages adding a down function to the migration. I usually close those PRs fast with a thank you and a message “We don’t use down migrations in our projects”.
While down migrations might seem like a safety net, they're often a false comfort that potentially creates more problems than they solve.
Instead of explaining this in every PR separately, let me share why we don't write down migrations and what we do instead.
– frederickvanbrabant.com - submitted by Frederick Vanbrabant
When someone comes to you with a question to do something, instead of blindly doing the ask, take a step back and try to understand what they actually want to achieve. Often this task might actually not be the best way to achieve the goal they are set out to do.
Read more [frederickvanbrabant.com]
We've converted our PHP and Laravel coding guidelines into AI-friendly instructions so Claude Code and other AI agents can generate code that matches our established programming style.
Read more [spatie.be]
– ryangjchandler.co.uk - submitted by Ryan Chandler
Have you ever been on a website and navigated between pages, only to notice that the layout shifts slightly because the scrollbar suddenly appears on longer pages?
Read more [ryangjchandler.co.uk]
Some interesting thoughts about caching.
Read more [buttondown.com]
The #[\NoDiscard] is a safety feature for PHP developers, making it easier to catch mistakes where ignoring a function’s return value could lead to bugs.
Read more [www.amitmerchant.com]
A deep dive on why projects always take longer and a framework to improve future estimation
Read more [davestewart.co.uk]
say: complexity very, very bad
Read more [grugbrain.dev]
Git notes are a powerful feature for adding metadata to commits, blobs, and trees.
Read more [tylercipriani.com]
A nice touch by Joel Clermont
Read more [masteringlaravel.io]
Brent is doing some interesting stuff here.
Read more [tempestphp.com]
A bottleneck isn’t inherently bad, we all have them. What matters is making sure your biggest bottleneck is always working at it’s most optimal conditions. That’s where your optimizations should be focused.
Read more [benmckay.com]
Something that you’ll need to often is casting the collection back to a regular array. Like me, you might be tempted to use toArray() for this. But that might be the wrong method to call.
Read more [spatie.be]
Users don’t know what your product does, how to use it, or why they would use it. You need docs to explain this.
Read more [newsletter.posthog.com]
– muhammedsari.me - submitted by Muhammed Sari
Group by type or context / process? One of these methods will crush your project's growth. Find out which!
Read more [muhammedsari.me]
– liamduckett.com - submitted by Liam
A short post about my preferences around type safety and static analysis.
Read more [liamduckett.com]
We've been using this solution in our projects as well.
Read more [darkghosthunter.medium.com]