Eloquent Query Classes Pattern
– wendelladriel.com - submitted by Wendell Adriel
Learn how to use Eloquent Query Classes to organize important database logic in Laravel without adding a full repository layer.
Read more [wendelladriel.com]
Posts tagged with database
– wendelladriel.com - submitted by Wendell Adriel
Learn how to use Eloquent Query Classes to organize important database logic in Laravel without adding a full repository layer.
Read more [wendelladriel.com]
AI coding agents love to run tests in parallel processes.
That's great until multiple processes try to use the same local test database at once. A small file lock can serialize access and stop those runs from stepping on each other.
Read more [rias.be]
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 publishes a super resourceful and practical newsletter. A must for anyone in the Laravel space"
A practical look at why you should populate essential data from migrations instead of seeders. Once your app is live, manually running seeders becomes a deployment risk. Migrations are deterministic, automatic, and roll back cleanly.
Read more [spatie.be]
We're proud to release v3 of laravel-site-search, a package that crawls and indexes your entire site. Think of it as your own private Google. Point it at a URL, let it crawl every page, and get full-text search results back.
Previous versions required Meilisearch as the search engine. That works well, but it means running a separate service.
With v3, your application's own database is all you need. It supports SQLite, MySQL, PostgreSQL, and MariaDB out of the box, and it's the new default.
Let me walk you through it.
Brent continues his optimization journey processing 11 million database events. Starting from 50k events per second, he implements combined inserts, skips unnecessary deserialization, and reaches 400k events per second. A great deep dive into PHP performance optimization.
Read more [stitcher.io]
The final part of Oh Dear's series on SQL performance. Mattias introduces phpunit-query-count-assertions, a package that catches N+1 queries, duplicate queries, and missing indexes in your test suite. Since implementing this at Oh Dear, they've eliminated 15% of their SELECT queries.
Read more [ohdear.app]
Mattias delves into optimizing SQL queries using indexes, focusing on MySQL 8.0. He explains how indexes work, how to analyze slow queries using MySQL’s EXPLAIN keyword, and the impact of different index configurations on query performance.
Read more [ohdear.app]
Database migrations have had a serious refactor in the newest Tempest release
Read more [tempestphp.com]
At Oh Dear, my colleague Mattias recently vastly increased the performance of our service. Here's how he did it.
Read more [ohdear.app]
Valkey is an interesting fork of Redis.
Read more [devdojo.com]
– ryangjchandler.co.uk - submitted by Ryan Chandler
SQLite's WAL mode makes using SQLite database much more production-ready.
Read more [ryangjchandler.co.uk]
– stancl.substack.com - submitted by Samuel Štancl
Some things to consider when using SQLite in production from the point of view of Laravel apps
Read more [stancl.substack.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.
– tighten.com - submitted by Kayla Helmick
Learn how to use SQL generated columns and database views in Laravel to simplify queries, boost performance, and make your data easier to filter, sort, and reuse across your application.
Read more [tighten.com]
Laravel’s new fillAndInsert() method enables bulk insertions while applying model casting, timestamps, and UUID generation.
Read more [www.harrisrafto.eu]
– tighten.com - submitted by Kayla Helmick
This article shares 10 efficient and fun ways to seed your database, from classic PHP arrays to importing CSVs and using AI to generate random, realistic data.
Read more [tighten.com]
Here are some special cases that you should keep in mind when working with NULL.
Read more [raymondtukpe.com]
The choice between the two depends on the specific requirements and use case of the application.
Read more [highperformancesqlite.com]
Pretty cool that this behaviour can be customized easily.
Read more [sarahjting.com]
Postgres has many nuances and best practices that are important to understand.
Read more [challahscript.com]