laravel

  • Laravel 5.6 broadcasting on a private channel

    A public channel broadcasts to anyone who subscribes, which is fine for a status page and wrong for anything showing a user their own data. The channel authorisation…

  • Assembling an API skeleton from packages you did not write

    A micro-framework, and the six packages it takes to make it useful. What goes in the starter pack, what does not, and when micro stops paying off.

  • Custom casts before there were custom casts

    Storing money as integer cents or a status as a string means every read needs converting, and the accessor pattern spreads that conversion across the model until nobody…

  • Lumen does not autoload config, and the one line that fixes it

    A config file dropped into config/ in Lumen is simply not read, and config(‘services.stripe.key’) returns null with no error — which costs an hour the first time. This…

  • Deleting a user is harder than creating one

    The delete request arrived and the row was the easy part. Foreign keys model structure, not ownership — and the person is in six other places.

  • The N+1 that does not appear in the query log

    340 queries on a page showing twenty rows, and none of them are slow. Every one is under the threshold, which is why the slow log has nothing…

  • A queue table is not a queue

    SELECT … WHERE processed = 0 LIMIT 1, and two workers taking the same row. SKIP LOCKED makes the table viable; it does not make it a broker.

  • Window functions replace a habit

    8.0 went GA in April and the correlated subquery can retire. The plans before and after, the recursive CTE that replaces a loop, and the upgrade nobody expects.

  • What the regulation actually asks of a schema

    The deadline is in May and the work is not a cookie banner. An inventory first, because everything else depends on knowing which tables hold what.

  • Single-server scheduling and the cron that ran three times

    Three application servers each running the same crontab means every scheduled task runs three times, and the invoice job discovers this before you do. The lock is a…