January 16, 2021 — Currently, there are two ways if you want to create ES6 class components in React.
January 13, 2021 — 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.
January 12, 2021 — Although the official PHP website’s documentation has a dedicated section on “Overloading”, it’s not truly called overloading by any means.
January 11, 2021 — Here’s a little tip about the artisan command that generates the controller. So, if you’ve used the
make:controller command with the
--resource option, it will generate controllers with create, read, update, and delete (“CRUD”) actions in them.
January 4, 2021 — Oftentimes, I stumble across a situation where I would need to center something and over the years I have tried different permutations and combinations. But all those somehow felt “hacky” and not something that is reliable.
January 3, 2021 — Before PHP 8, whenever you wanted to get the type of a variable, you could use the native gettype function. Check the examples below.
December 30, 2020 — When working with polymorphic relationships in Laravel’s Eloquent, it’s important to specify the “type” of the related model. You can do this by using
December 28, 2020 — Sometimes, it’s kind of fascinating to know the origins of the products/projects we love. I personally find these stories quite amusing and insightful at the same time and so, here’s a collection of such software products/projects/companies and the stories of how they got their name.
December 23, 2020 — Up until now, when you want to throw exceptions from your code, you would use the
throw keyword to throw the exception which can be caught by the
catch block like so.
December 21, 2020 — There might be some situations where you would want to crawl a third-party website and perform some actions right from your PHP codebase. For instance, submitting forms, logging into your account, clicking links, etc. to add some degree of automation in your workflow.
Follow me elsewhere