Posts About Laravel
Laravel is a powerful PHP framework that simplifies web development with its elegant syntax and comprehensive toolkit. It streamlines tasks like routing, authentication, and caching, making it ideal for both simple and complex applications.
What Happens When the Queue Store Goes Down
Most queue advice assumes the queue is there. It usually is. But Redis restarts, a managed database fails over, a security group changes, and...
Horizon Is Filling Up Your Redis
Redis memory keeps climbing. You check the queues and they are empty, or near enough. Nothing is backed up, nothing is stuck, and yet the inst...
Running Extra Workers Only at Peak
Look at a graph of your queue depth over a day and it is rarely flat. A nightly import lands at two in the morning, order traffic peaks late a...
Adding a Second Worker Server
One server has been running the app and its workers happily. Traffic grew, the queue backs up every afternoon, and the obvious move is a secon...
Running Laravel Queue Workers Under Supervisor
A worker exits at three in the morning. Maybe it hit its memory limit, maybe the process was killed, maybe a fatal error took it down. Nothing...
Why Your Job Sees Data From the Last Job
Customers start receiving notifications in the wrong language. Not everyone, and not consistently: a French customer gets French, then the nex...
How Many Queue Workers Should You Run?
"How many workers should we run?" usually gets answered with a number somebody remembers from a previous project. You can do better...
Your Worker Is Listening to the Wrong Queue
Rows are accumulating in the jobs table. A worker is definitely running, because you can see the process. Nothing is being processed, and ther...
Running Work After the Response Without a Queue
Not every slow thing deserves a queue. Warming a cache entry, writing an analytics row, pinging a webhook you do not care much about: all wort...
dispatch() Queues Later Than You Think
Here is a small mystery. You dispatch a job, then do something else in the same method, and the ordering is not what you wrote: The log line c...
The First Job in a Chain Carries the Whole Chain
A tenant-provisioning flow grew organically: create the schema, seed the defaults, warm a few caches, sync the billing record, send the welcom...
Should Your Jobs Run in Order or All at Once?
You are importing a supplier's product feed. Parse the file, process forty thousand rows, then rebuild the search index and email whoever kick...
Reporting Exceptions in Laravel
Reporting is the half of exception handling the user never sees. When something goes wrong, you want a record of it so you can find out what h...
Switching Queue Drivers in Laravel Without Downtime
Each queue driver has its strengths, and one day you may want to move from one to another, say from the database driver to redis as you grow....
Log In with Either Username or Email in Laravel
A nice touch for users is one login field that accepts either their username or their email, instead of forcing them to remember which they si...
Customising the Password Reset Email in Laravel
Laravel sends a perfectly fine password reset email out of the box, but it is plain and unbranded. When a reader asked how to replace it with...
Stop All Your Jobs Retrying at the Same Moment
A search-index provider has a bad ten minutes. Three thousand product-sync jobs fail, each one with $backoff = 600. Ten minutes later the prov...
Removing Jobs of a Specific Type From a Laravel Queue
Here is a real incident. A pull request was merged by mistake and pushed one particular job to the queue more than a hundred thousand times. T...
Limiting How Many Jobs Hit an API at Once
A supplier lets you hold five connections open. You run twenty workers, and a stock-sync job goes onto the queue for every product you carry....
Creating a One to Many Relationship in Laravel
A one to many relationship, also called a has many, is when one row in a parent table matches many rows in a child table. This is the relation...