The short answer

Building Ewoi Builds, six things broke in ways worth learning from: Blade directives that silently did not compile, a Laravel 13 cache safety rule, search tests that saw no data, a local server that could not find its routes, a seeder that tripped a lazy-loading guard, and a booking race that only a database rule could stop. Each one below has the symptom, the cause and the fix.

Build log, 14 to 15 November 2026.

Ewoi

Every bug here looked mysterious at first and obvious afterwards. That is normal. The skill is getting from the first feeling to the second quickly.

1. Blade directives that printed as text

Symptom: a page showed the literal text @if (support_links()) instead of running it.

Cause: Blade only recognises a directive such as @if when it follows a space or a symbol. In a long, single-line template, ...works@if was glued to the word before it, so Blade treated it as plain text.

Fix: a space before every directive, and a test that scans every template for directives glued to a word. The test has caught the same mistake twice since.

Lesson: when a framework rule is easy to break by accident, write a test for the rule itself, not just for one page.

2. The cache refused to read its own data

Symptom: after caching some content, reading it back failed.

Cause: for safety, Laravel 13 only allows the cache to rebuild objects of classes you list. Unserialising arbitrary objects is a known attack path, so anything not listed is refused.

Fix: list exactly the classes the cache stores, in the cache configuration, and nothing more.

Lesson: when a new framework version breaks old code, read its upgrade notes before working around it. The "break" was a security improvement.

3. Search tests that found nothing

Symptom: tests for Ewoi's search inserted lessons, searched, and got no results, although the same search worked in the browser.

Cause: the search uses a MariaDB full-text index. Tests normally run inside a database transaction that is rolled back afterwards, and the full-text index does not see rows that were never committed.

Fix: those tests empty the tables before each test instead of using a transaction.

Lesson: a test environment that differs from production in one small way (here, an uncommitted transaction) can hide or fake bugs. Know what your test setup does for you.

4. Every page was "not found" in the browser tests

Symptom: the browser test server returned 404 for every page, the home page included.

Cause: PHP's built-in development server, php -S, serves files from the folder it is started in unless you give it a document root. Laravel's only entry point is public/index.php, so a server started from the project root found nothing to run for any address.

Fix: point the server at the public folder:

php -S localhost:8000 -t public

-t public sets the document root. Inside a Laravel project, php artisan serve does the same for you.

Lesson: when everything fails the same way, look for one shared cause (here, configuration), not many separate bugs.

5. The demo data stopped loading

Symptom: loading example data for local testing crashed with a lazy-loading error.

Cause: the app is configured to forbid lazy loading (fetching related rows one at a time without asking), because it causes slow pages (the "N+1 queries" problem). The seeder read a learning path's lessons the lazy way.

Fix: ask for the related rows explicitly with a query.

Lesson: a strict guard that annoys you in a seeder is protecting your real pages. Fix the code, keep the guard.

6. Two people booking the same hour

Symptom: in testing, two learners could, in theory, pick the same private-training slot at the same moment, and both see "booked".

Cause: checking "is this hour free?" and then saving the booking are two steps. Between them, another request can save the same hour.

Fix: a unique rule in the database on the held slot. The second save fails, the app catches that failure, and the learner is asked to choose another time. Releasing a slot clears the value, so the hour becomes bookable again.

Lesson: "check, then act" is never safe on its own when two people can act at once. Let the database enforce the rule; it is the only part that sees every request in order. The same idea protects payments in our M-Pesa tutorial.

Ask your AI assistant

I have a bug: [describe the symptom exactly, with the error]. Before suggesting a fix, list three possible causes in order of likelihood and the quickest check that would confirm or rule out each one.

Key takeaways

  • Write tests for easy-to-break rules, not only for features.
  • Read upgrade notes: some "breaks" are security fixes.
  • Know how your test setup differs from production.
  • Look for one shared cause when many things fail the same way.
  • Let the database enforce rules that must hold under concurrency.

Check your understanding

1. Why did the search tests find nothing?

The data existed only inside a transaction that was never committed, which the index ignores.

2. Two requests book the same slot at the same moment. What reliably stops the double booking?

Only the database sees every save in order, so it is the right place to enforce "one booking per hour".

3. Every page returns 404 in the same way. What should you suspect first?

Identical failures usually share a cause; here it was the folder the server started from.

Found this useful?

Every lesson stays free. Tap the thumbs up so we know what works, or say thanks with a soda or a coffee: it pays for hosting and new lessons.

Buy me a sodaBuy me a coffee

Related

WhatsApp

Join the channelChat with us

Free lessons and updates in the channel. Questions about learning or training? Chat with us.