Remove or omit object properties without mutation in JavaScript
March 1, 2021 — Since immutability in JavaScript is important for predictability and performance of your application, we often find ourselves in situations where we need to achieve some of the operations without mutating the original object/array.
Retrieve HTTP response as a collection in Laravel 8.x
February 27, 2021 — Sometimes, when working with HTTP responses, you might want to retrieve the entire response as a Laravel collection to make further manipulations.
Adding lines conditionally in Laravel's Mail notifications
February 23, 2021 — When working with Mail notifications in Laravel, you’ll often be in a situation where you would want to render something based on some condition.
Mutation-free JSON column updation using AsArrayObject Eloquent cast
February 21, 2021 — If you have worked with a Large scale Laravel application, there might be a great chance that you would have to use JSON columns to save some information in your tables.
Publish now, fix later
February 12, 2021 — Yes! this is the strategy I have been following for my blog for quite some time now. It has helped me publish articles frequently and it has suited my schedule quite well.
Limit the number of returned segments in PHP's explode()
February 10, 2021 — PHP’s documentation is a goldmine of little but helpful things which is when explored can help improve your code. But this kind of thing tends to get overlooked easily.
Tappable and pipeable fluent strings in Laravel 8.x
February 7, 2021 — 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.
Native enumerations (enums) are coming in PHP 8.1
February 7, 2021 — 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.
Array unpacking with string keys coming in PHP 8.1
January 28, 2021 — The spread operator in PHP is getting more awesome in PHP 8.1! So, to give you a primer, with the release of PHP 7.4, it got possible to merge multiple arrays by unpacking arrays into another array using the spread operator.