laravel

  • Designing an API two mobile clients can live with

    Two apps, two release cycles, and neither can be forced to update. What is additive, what is not, and the decisions that have to be made before the…

  • withoutOverlapping on a scheduled command

    A scheduled task that occasionally runs longer than its interval will be started again while the first is still going, which for an import means two processes writing…

  • Laravel 5.4 dropped the model events you were using

    5.4 removed the string-based model events fired through the event dispatcher — eloquent.saved: AppOrder and its relatives — in favour of an $dispatchesEvents map to real classes. The…

  • Schema changes that do not need a maintenance window

    An ALTER on a 40 million row table held a metadata lock behind every query. Expand, migrate, contract turns one blocking release into three safe ones.

  • Queue retry_after and the job that runs twice

    The queue worker’s –timeout and the connection’s retry_after are two different clocks, and getting their order wrong is the most common cause of a job silently running twice.…

  • Laravel 5.5 and the packages that install themselves

    The first release where installing a package is one command. Auto-discovery removes two config edits per package, and hides the fact that they happened.

  • Custom collection classes on a model

    Behaviour that belongs to a set rather than to a single record — the total of a group of order lines, whether any of them is backordered —…

  • Read replicas, and the queries that must not use them

    Reads moved to a replica and checkout started showing empty carts. Read-after-write, sticky connections, and measuring the lag rather than assuming it.

  • Assert against the database, not against the response

    A feature test asserting a 302 and a flash message proves the controller ran. It does not prove the order was created, and it passes just as happily…

  • Blade components before they were components

    @include passes variables and shares the parent scope, which means a partial silently depends on whatever happened to be defined where it was included. @component takes a slot…