Reader Stacks

GUIDES

Databases & APIs

Database design, queries, and REST/GraphQL API practices.

Database Transactions in Laravel

Any operation touching more than one table — where a partial failure would leave the data in a genuinely inconsistent state — belongs inside a transaction, not left to run as separate, independent queries.

Laravel Eloquent Where Clauses: A Practical Reference

whereIn, whereNull, orWhere, and a handful of siblings cover almost every filtering need — the one that actually causes bugs is orWhere's grouping behavior when mixed with other conditions.

Making HTTP Requests From Laravel With the Http Facade

Laravel's Http facade is a fluent wrapper around Guzzle — the current standard way to call an external API, replacing hand-rolled cURL or file_get_contents calls for anything server-to-server.

Querying JSON Columns in Laravel

MySQL and PostgreSQL both support indexing and querying inside a JSON column directly — Eloquent exposes that through arrow syntax and dedicated whereJson* methods, without raw SQL.

Laravel Migrations: Renaming and Dropping Columns

Renaming a column, dropping one, and dropping a foreign key each have a specific gotcha — a dependency on doctrine/dbal for renames on older Laravel, and getting the foreign key's actual constraint name right for drops.