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.

502 Bad Gateway Nginx: Causes and How to Fix It

10/21/2026

502 Bad Gateway Nginx: Causes and How to Fix It

Fix 502 Bad Gateway in Nginx step by step: read error.log, then solve connection refused, PHP-FPM socket and permission errors, crashed workers, big headers and Docker upstream issues.

By Muhammad Wilayat Shah

Read
Four layers of Laravel access control: permissions such as invoices.approve checked on every route, roles that bundle permissions as job titles, policies for record rules such as an approval limit, and Pennant feature flags for rollouts that are not permissions

10/21/2026

Laravel Role Based Permissions: RBAC and Feature Access

Our ERP finance module moved from is_admin to roles, permissions, policies and feature flags. The setup we use with spatie/laravel-permission and Pennant, and seven errors we hit, each reproduced with real output.

By Muhammad Wilayat Shah

Read
Four steps to fix a CORS error between React and Laravel: read the Chrome console message, reproduce the preflight with curl -X OPTIONS and an Origin header, fix paths, allowed origins and credentials in config/cors.php, and run php artisan config:clear

10/20/2026

CORS Error in React and Laravel: How to Fix It

A new developer on our school ERP got a blank React dashboard and a CORS error while production worked. Here is how I read the Chrome message, reproduce the preflight with curl and fix Laravel's CORS config.

By Muhammad Wilayat Shah

Read