How to optimize ORDER BY RANDOM()
Tobias explains how you can make this operation very fast even if your table has several million records.
Read more [tpetry.me]
Tobias explains how you can make this operation very fast even if your table has several million records.
Read more [tpetry.me]
– www.laravel-enlightn.com - submitted by Paras Malhotra – Edit
An in-depth guide on offset and cursor pagination in Laravel, and the pros and cons of each.
Read more [www.laravel-enlightn.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.
"As a Laravel developer, this is the one newsletter I most look forward to. Freek has a talent for distilling packages or techniques down to something immediately useful - one tip can save you hours and even weeks. It's concise and practical and highly relevant."
by Freek Van der Herten – 1 minute read – Edit
Here's the recording of Laravel Wordwide Meetup #8. My guests for this edition were Kai Sassnowski talking on the importance of DB indexes, and Sebastian De Deyne on how to use Vite in Laravel.
by Freek Van der Herten – 8 minute read – Edit
There are many SaaS applications that allow potential new customers to try out the service using a trial period. Of course, not everybody will convert. After the trial period is over, some people will not use the service anymore. However, if nothing is being done about it, their email address and…
I needed to display only the first picture from my Product's model media collection and found my app running five queries and hydrating 16 models with only four products to display 😱 . Here's how I ended with only two queries and eight models.
Read more [naxon.dev]
– atymic.dev - submitted by atymic – Edit
Overview of the new upsert feature in Laravel 8.10, how to use it and some tips.
Read more [atymic.dev]
– timacdonald.me - submitted by Tim Mac – Edit
Here's how to handle moving from a classic foreign key constrained relationship, to a polymorphic relationship in Eloquent, without impacting the end user.
Read more [timacdonald.me]
– flareapp.io – Edit
When reviewing the contents of the database of Flare, we encountered a table with 1 billion records. Technically that isn't a problem. Flare runs on Vapor and uses an Aurora database, so it can handle that scale. But of course, there's a cost for storing that many records.
We dove in and concluded that we could safely delete about 900 million records. They all were created before a specific date.
Read more [flareapp.io]
Dan Manson explains how you can run that shiny new schema:dump command on GitHub actions. Pretty cool
Read more [fidum.uk]
– hakibenita.com – Edit
Databases are the backbone of most modern systems, so taking some time to understand how they work is a good investment for any developer.
Read more [hakibenita.com]
Matthias Noback shares his thoughts on when you should and when you shouldn't rely on the database to perform certain tasks
Read more [matthiasnoback.nl]
by Freek Van der Herten – 3 minute read – Edit
Using our laravel-model-cleanup package, you can easily remove old unneeded records from your database. We recently released a new major version that adds support for safely cleaning out huge tables.
In this blog post, I'd like to introduce this new release of the package to you.
– reinink.ca – Edit
Jonathan Reinink published another excellent blogpost on db performance.
Read more [reinink.ca]
– medium.com - submitted by Pavol Perdik – Edit
In this article Pavol Perdik writes about the native PostgreSQL type daterange and how to easily use it in Laravel.
Read more [medium.com]
Laurie Voss, co-founder of npm, explains how databases work, what the difference is between MySQL and something like Redis, why MySQL is popular and much more!
My twitter-friend Simon had a simple question that contained much complexity: how do databases work? The result was an absurdly long thread of 70+ tweets, in which I expounded on the workings and history of databases as used by modern web developers, and Simon chimed in on each tweet with further questions and requests for clarification. The result of this collaboration was a super fun tiny explanation of databases which many people said they liked, so here it is, lightly edited for clarity.
Read more [seldo.com]
– twitter.com – Edit
sql tips: you can group by anything pic.twitter.com/YoJVlUyghG
— ?Julia Evans? (@b0rk) 29 september 2019
Read more [twitter.com]
CASE is SQLs answer to other programming languages IF-ELSE statement. If you need to test a condition and return a value CASE is the expression you need.
Read more [www.helenanderson.co.nz]
– twitter.com – Edit
And if you're a @laravelphp user wondering how you can use this feature, you can easily extend the query builder to support this. ?
— Jonathan Reinink (@reinink) July 16, 2019
Gist here: https://t.co/Wuavz0v7p9 pic.twitter.com/Vy6NJdJbcx
Read more [twitter.com]
– reinink.ca – Edit
Jonathan Reinink wrote another awesome post on how to handle a complicated query.
I was asked recently how to calculate multiple totals (aggregates) in Laravel in the most efficient way. For example, maybe you have an email subscription service and want to display various totals based on your subscribers
Read more [reinink.ca]
– laraveldaily.com – Edit
Povilas Korop explains how to use a raw groupBy in Laravel. Cool!
Read more [laraveldaily.com]