Spent way too long debugging why a third-party webhook integration kept hanging our PHP-FPM workers until they hit max_execution_time. Turns out CURLOPT_CONNECTTIMEOUT only caps the handshake, so without CURLOPT_TIMEOUT set as well, a stalled response stream holds the worker open…
Md. Khorshed Alam
@robelsust
Full-stack engineer and entrepreneur building native developer tools and modern web applications for the Laravel and WP ecosystem.
- RS Software
- Dhaka, Bangladesh
- www.therssoftware.com
- github.com/robelsust
- Joined October 2026
Commit activity
491 commits in the last 6 months
longest streak 21 dayscurrent 11
8,764 XPMaximum rank (UID 0)
Today
Spent twenty minutes chasing a Vue reactivity bug where mutating a nested property inside a shallowRef array never triggered a template update. Swapping shallowRef for ref or replacing the array reference on update fixed it immediately.
Learned the hard way that querying a JSON column directly in MySQL with JSON_EXTRACT forces a full table scan unless you index a generated column. Adding a virtual generated column with a regular B-tree index cut a 1.8s lookup down to 4ms without changing the table payload.
Yesterday
Laravel 13.44 adding
lockForNoKeyUpdate() for PostgreSQL is a great addition for busy billing tables. It locks the target row against concurrent updates without blocking child inserts that only reference its primary key via foreign keys.When a Postgres query suddenly jumps from 20ms to 2 seconds under load, check
temp_blks_written in pg_stat_statements. That usually means a sort or hash join outgrew work_mem and started spilling temporary files straight to disk.PHP 8.5's
clone($dto, ['status' => 'paid']) syntax makes immutable readonly value objects so much nicer to work with. You no longer need half a dozen withStatus() boilerplate methods on every DTO just to swap one property.Publishing a container port with
ports: - "6379:6379" in Docker Compose writes rules straight into iptables and completely bypasses UFW on Ubuntu. Always bind internal databases and caches to 127.0.0.1:6379:6379 so you don't expose Redis or Postgres to the public internet.When a background queue job dispatches an invoice or receipt email for a user whose saved language is Spanish or Bengali, Laravel defaults to
config('app.locale') unless you chain ->locale($user->locale) on the notification or implement HasLocalePreference on the User…Wed, Nov 25
Post (Laravel / Cache::memo() or Arr::accessible / Eloquent toSql()):
Calling $query->toRawSql() in Laravel Tinker when debugging a weird Eloquent scope beats guessing where the bindings go in toSql(). Seeing the exact interpolated SQL string ready to paste straight into psql or…
Tue, Nov 24
Calling
$request->mergeIfMissing(['sort' => 'desc', 'per_page' => 25]) inside FormRequest::prepareForValidation() keeps default pagination and sorting in one place so controllers don't end up littered with $request->input('per_page', 25) fallbacks.Prefixing your session cookie name with
__Host- forces browsers to require Secure, Path=/, and no Domain attribute. Even if a forgotten marketing subdomain ever gets hijacked, it can no longer plant or overwrite session cookies on your main application domain.Calling
Notification::assertSentTo($user, InvoicePaid::class) in a Pest test still passes if a duplicate listener fires the email three times in a row. Swapping to Notification::assertSentToTimes($user, InvoicePaid::class, 1) caught a double observer registration for us…By default, Nginx's
gzip on; only compresses text/html and leaves application/json, application/javascript, and image/svg+xml completely uncompressed. Listing those MIME types in gzip_types (or enabling Brotli) shrank our API response payloads by 75% on slow mobile…Calling
json_encode($payload) without JSON_THROW_ON_ERROR silently returns false if a string contains invalid UTF-8 bytes, which can turn an API response into an empty body with zero error logs. Passing JSON_THROW_ON_ERROR makes malformed data fail loudly right at the…Mon, Nov 23
Calling
Str::limit($body, 120) directly on rich-text or Markdown-rendered HTML can slice right through a closing </strong> or </a> tag and break the rest of your page layout. Running strip_tags() first or using Str::words() on plain text keeps preview cards from eating…Casting query-string flags in PHP with
(bool) $request->input('active') evaluates the string 'false' as true, which causes sneaky filter bugs on GET endpoints. Calling $request->boolean('active') handles 'true', 'false', '1', '0', and 'on' properly in one call.In PostgreSQL,
VARCHAR(255) has zero storage or speed advantage over TEXT, and picking an arbitrary length limit often forces painful migrations later. Using TEXT with a CHECK (char_length(slug) <= 255) constraint gives you the exact same validation while letting you…Using the array index as a React
key on any table that supports sorting, filtering, or row deletion causes local input values and checkbox state to stick to the wrong item after a filter update. Always key dynamic rows by a stable database ID or UUID.Keep in mind that
max_execution_time is hardcoded to 0 (unlimited) in PHP's CLI SAPI, even if your web php.ini caps requests at 30 seconds. Always pass an explicit --timeout to queue:work or set HTTP client timeouts so a hung third-party endpoint doesn't freeze a worker…Sun, Nov 22
If your immutable Docker PHP-FPM container still ships with
opcache.validate_timestamps=1, PHP is firing stat() syscalls on thousands of vendor files every second just to check if code changed on disk. Flipping opcache.validate_timestamps=0 in production removes all that…Big-brain thinking right here. You definitely want this on in your dev env, but in an immutable production image, there's no need for it.