Skip to content

Category

software development

Practical software engineering from a team lead: clean code, SOLID, refactoring, debugging, backend design and system architecture with Laravel and React.

How to Optimize Laravel Eloquent for Large Databases

10/29/2026

How to Optimize Laravel Eloquent for Large Databases

Eloquent slow on big tables? A practical laravel eloquent optimization guide: measure queries, fix N+1 with eager loading, select only needed columns, chunk large results and add the right indexes.

By Muhammad Wilayat Shah

Read
Four checks for a Laravel session that expires too soon: confirm the real config with config:show session, make the cookie secure flag, domain and SameSite match the site, use database or redis sessions when there are two or more servers, and keep one APP_KEY everywhere with APP_PREVIOUS_KEYS for rotation

10/29/2026

How to Fix Laravel Session Expired Problems

Teachers on our school system kept landing on the login page after we added a second server. Six real causes of Laravel sessions expiring early, each reproduced on Laravel 13 with the output and the fix.

By Muhammad Wilayat Shah

Read
Four layers that prevent duplicate form submissions in Laravel: disable the button and redirect after POST in the browser, Cache::lock per record for parallel requests, idempotency keys for API retries, and a unique index in the database

10/28/2026

How to Prevent Duplicate Form Submissions in Laravel

A slow button at a hospital reception created 31 double invoices in one day, even with a unique rule. Here is what really stops duplicate submissions in Laravel: locks, unique indexes, idempotency keys and PRG, tested in a lab.

By Muhammad Wilayat Shah

Read