Refuse attributes a model will throw away
Catch a typo in a fillable list during development, before the column quietly stays null.
use Illuminate\Database\Eloquent\Model;
Model::preventSilentlyDiscardingAttributes(! app()->isProduction());Snippets you can paste today, and short courses that take you from “it works” to “it’s brilliant”.
Everything is free. No account, no card, no catch.
Paste-ready Laravel, with the explanation and the video on each page.
Catch a typo in a fillable list during development, before the column quietly stays null.
use Illuminate\Database\Eloquent\Model;
Model::preventSilentlyDiscardingAttributes(! app()->isProduction());public function voided(): static
{
return $this->state(fn () => [
'status' => 'void',
'voided_at' => now(),
]);
}A factory state keeps a void invoice readable in the test, instead of a pile of overrides.
Read the snippetuse Illuminate\Queue\Middleware\WithoutOverlapping;
public function middleware(): array
{
return [new WithoutOverlapping($this->invoiceId)];
}WithoutOverlapping holds a lock for one model so a double dispatch waits its turn.
Read the snippet// app/Providers/AppServiceProvider.php
use Illuminate\Database\Eloquent\Model;
public function boot(): void
{
Model::preventLazyLoading(! app()->isProduction());
}Turn lazy loading into an exception outside production, so missing eager loads fail loudly in development and tests.
Read the snippetShort, focused courses, all free. Each one tackles a single topic properly, in lessons you can finish on a lunch break.
Relationships, scopes, casts and query performance, built up from a real app rather than toy examples.
13 lessons · 2 hr 10 min · Intermediate
Retries, backoff, batching and idempotent jobs, so background work keeps running when things go wrong.
10 lessons · 1 hr 35 min · Advanced
Feature tests, fakes and factories that give you the confidence to refactor without fear.
15 lessons · 2 hr 40 min · All levels
Queued work should wait until the invoice transaction commits, and disappear if it rolls back.
26 Oct · 9 min read
What happens when a job runs twice, and how to make sure it doesn’t matter.
14 Oct · 9 min read
Authorisation, preparation and after-validation hooks that tidy up fat controllers.
7 Oct · 9 min read
When to cache, what key to use, and how to invalidate without tears.
30 Sep · 8 min read
A short decision guide with examples from a multi-tenant app.
23 Sep · 10 min read
One snippet and the week’s Laravel news, in your inbox every Friday morning. Unsubscribe whenever you like.
We remember the videos you watch, where you left off, and which series lessons you mark as read, against this connection’s address. Nothing is stored until you agree.