Join thousands of developers

Every two weeks, I share practical tips, tutorials, and behind-the-scenes insights from maintaining 300+ open source packages.

No spam. Unsubscribe anytime. You can also follow me on X.

APP_KEY And You

tighten.co

Jake Bathman, developer at Tigthen Co, wrote a new blogpost explaining what Laravel's APP_KEY environment variable is used for.

In this post, we'll talk about what APP_KEY does and doesn't do, some common misconceptions about its relationship to user password hashing, and the simple steps to changing your APP_KEY safely without losing access to your data.

Read more [tighten.co]

Using Travis-CI for your Laravel Nova packages

marcelpociot.de

Now that Laravel Nova can be installed via composer, we can run tests for Nova packages and projects on Travis CI. My friend Marcel Pociot explains how.

This is great news, as this does not only simplify updating Laravel Nova, but it also allows Nova tools/package developers to add continuous integration to their projects! But there is still a problem: we do not want to provide our Laravel Nova credentials in our open source repository. But how can we solve this?

Read more [marcelpociot.de]

Union Types vs. Intersection Types

medium.com

In an older but still relevant blogpost, Ondřej Mirtes, the author of PHPStan, explains the difference between union types and intersection types.

One of the headlining features of PHPStan 0.9 is the introduction of intersection types. Since this is a very useful feature that helps us understand the code much better, but the terminology is largely unknown and mysterious to the PHP community, I decided to write up and compare these two kinds of compound types.

Read more [medium.com]

Community-driven PHP 8 Wish List

blog.nikolaposa.in.rs

Nikola Poša did some light research on what features PHP developers are craving for to be added in PHP 8. Seems like I'm not the only one that wants arrow functions and generics.

It's been over two months since I started a research on Twitter about the things that developers would like to be added or improved in the next major PHP release. It had a surprisingly long reach, inspiring developers, prominent experts, community representatives to express their opinion through more than a hundred responses.

Read more [blog.nikolaposa.in.rs]

Extended Validation Certificates are Dead

www.troyhunt.com

In a new blogpost Troy Hunt explains why you shouldn't bother buying an EV certificate anymore.

That's it - I'm calling it - extended validation certificates are dead. Sure, you can still buy them (and there are companies out there that would just love to sell them to you!), but their usefulness has now descended from "barely there" to "as good as non-existent". This change has come via a combination of factors including increasing use of mobile devices, removal of the EV visual indicator by browser vendors and as of today, removal from Safari on iOS

Read more [www.troyhunt.com]

Test Contra-variance

blog.cleancoder.com

In an older but still relevant article on the Clean Coder Blog, Uncle Bob argues that the structure of your tests should not necessarly reflect the structure of your code.

The structure of the tests must not reflect the structure of the production code, because that much coupling makes the system fragile and obstructs refactoring. Rather, the structure of the tests must be independently designed so as to minimize the coupling to the production code.

Read more [blog.cleancoder.com]

Introducing Phoenix.LiveView

Phoenix is a framework written in Elixir. It's creator, Chris McCord, showcased an impressive new feature called LiveView at ElixirConf.

LiveView is an extension of standard Phoenix views that will automatically propagate updates to the browser anytime state changes that would impact that view (using the existing Phoenix channels infrastructure). Instead of sending a state change event down the wire that you have to process in JavaScript manually, LiveView sends down an updated HTML fragment, diffs it against the current DOM state, and makes the necessary mutations for you.

Here is some more background info on LiveView: https://leveljournal.com/why-phoenix-liveview-is-a-big-deal

Read more

Verifying Laravel Version Compatibility

blog.tjmiller.me

TJ Miller shares a cool Travis config to tests against all versions of Laravel.

As Laravel 5.7 is now out, I needed to add support to both the package’s composer configuration and verification in CI. Previously, I only needed to verify against 5.5 and 5.6 I thought that having --prefer-lowest in the matrix would add the coverage I needed. Now that I am supporting three versions I felt that I needed a more specific way of verifying compatibility with different versions of Laravel.

Read more [blog.tjmiller.me]

A tags field for Nova apps

by Freek Van der Herten – 4 minute read

A while ago I ditched the custom admin of this blog in favour of Laravel Nova. As you might have noticed every blog post on murze.be has some tags. Nova ships with many form fields but a field to use tags is not included out of the box. That's why I created my own tags field and released it as…

Read more

Introducing Laravel view models

stitcher.io

My colleague Brent released another awesome package called laravel-view-models. On his blog he shares some good examples and uses cases.

In essence, view models are simple classes that take some data, and transform it into something usable for the view. In this post I'll show you the basic principles of the pattern, we'll take a look at how they integrate in Laravel projects, and finally I'll show you how we use the pattern in one of Spatie's, our company, projects.

Read more [stitcher.io]

Bitmask Constant Arguments in PHP

medium.com

Liam Hammett explains what bitmask constants are and how they work.

PHP has a handful of core functions that can accept boolean arguments in the form of constants that have a binary value. These can be combined together in a single function argument, essentially passing multiple boolean flags in a very compact manner. They work a bit differently to how most people implement options in their userland functions, so let’s take a look at how they work.

Read more [medium.com]