laravel

  • Route model binding with a custom key per route

    getRouteKeyName() changes the binding column for a model everywhere, which is wrong when the admin addresses an order by id and the customer addresses it by reference. An…

  • Package auto-discovery, and how to opt a package out

    5.5 reads a package’s extra.laravel block and registers its providers and aliases automatically, which removes two config edits from every installation and removes them from view as well.…

  • Mix is webpack with the config already written

    Elixir wrapped gulp, which wrapped everything else. Mix wraps webpack directly, which removes a layer and — more usefully — leaves the underlying configuration reachable when the abstraction…

  • The asset pipeline Laravel 5.4 shipped

    Elixir wrapped gulp, which wrapped everything else. Mix wraps webpack directly — and leaves the configuration reachable when the abstraction runs out.

  • API resources replaced the transformer package

    Shaping a model for JSON has meant a transformer library or toArray() on the model, and the second couples the wire format to the database columns — so…

  • Telescope does not exist yet; here is the query log

    Finding out what queries a request actually ran means either a package, a debug bar that changes the page, or the listener that has been in the framework…

  • with() eager loads now; load() does it afterwards

    Both solve the same N+1 problem and they apply at different moments, which decides whether the collection you already have can be fixed or has to be re-fetched.…

  • Queues, workers and the jobs that fail twice

    The email that arrived four times and the charge that arrived twice. What makes a job safe to run again, and keeping workers alive without them serving stale…

  • Collections: pipe and tap keep a chain readable

    A collection chain reads well until it needs one step that is not a collection method — a log line, a total computed from the whole set —…

  • Laravel 5.3 notifications unified the channels

    Sending the same event by email, SMS and a database record meant three call sites and three formats to keep in step. 5.3 makes the notification one class…