Join 9,500+ smart developers

Get my monthly newsletter with what I learn from running Spatie, building Oh Dear, and maintaining 300+ open source packages. Practical takes on Laravel, PHP, and AI that you can actually use.

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

Best Practices for Using PHP Enumerations

jeffochoa.me - submitted by Jeff

Although PHP Enumerations are meant to provide an easy and elegant solution to work with a predefined set of values, these classes are often misused, resulting in a lack of consistency due to the introduction of all sorts of methods that increase their complexity. In this article, we are going to go through some practices (both good and bad) with the goal of clarifying the understanding of these types of objects to help you build a more resilient and consistent codebase.

Read more [jeffochoa.me]

Workbench App for Packages

world.hey.com - submitted by Tony Messias

A new package by Mior called Workbench lets us set up an example Laravel app inside our packages. This Workbench app can serve as documentation of how the package integrates with a Larave app. Plus, we can use the Workbench models, controllers, routes, etc., in our package's tests and quickly run the Workbench app in the browser!

Read more [world.hey.com]