Tappable and pipeable fluent strings in Laravel 8.x

— The fluent string operations were introduced back in the release of Laravel 7 which offered a more object-oriented, fluent string manipulation library built on top of Illuminate\Support\Str functions. To use this fluent API, you’d need to use the Illuminate\Support\Str::of method which creates a fluent Illuminate\Support\Stringable object.

Read More ⟶

Native enumerations (enums) are coming in PHP 8.1

— Enums or enumerations or enumerator types are those little data structures that can be used to define a set of named values. More like constants. For instance, a contract status which can be “permanent”, “temp”, or “apprentice”. Or a order status that can be “ordered”, “dispatched”, “shipped” etc.

Read More ⟶

Retry operations with high probability of failure in Laravel

— There are certain operations that can have a high probability of failure. For instance, sending a request to a third-party API. You’re not sure whether it will work every time flawlessly because it’s not in your control. If the API endpoint you’re hitting is not responding, you might end up with an exception straight away.

Read More ⟶

A little known artisan command that can inspire you

— While working on your codebase, be it developing features for your application or fixing bugs, we all tend to get a little bit demotivated sometimes in the middle of those sessions. Because after all, we are all humans and we all need some kind of inspiration every now and then.

Read More ⟶

How to prevent overlapping of jobs in Laravel

— When you are using Laravel queues, you might bump into the situation where you want to prevent overlapping of jobs that handles sensitive information. This could be to provide data integrity of important information such as the user’s wallet balance.

Read More ⟶

Deep copying objects using JSON.stringify and JSON.parse

— There are a lot of reasons where you would want to “deep copy” objects in your application. For instance, when working with React.js, you might have used the shouldComponentUpdate life-cycle method. In this method, you would determine if the component has the same props and state as it had previously by shallow or deep copying objects.

Read More ⟶