Category: polymorphism

What Are Polymorphic Relations and How Do We Use Them with Eloquent?

While I was working on an application for a client, I had to implement a new module that entails the following: Users ask for a budget quotation for a certain task. Every task has a location. Professionals can subscribe to different zones. A zone can be a region or a city. Now, let’s neglect the core applicatio...

Object-oriented JavaScript: A Deep Dive into ES6 Classes

Often we need to represent an idea or concept in our programs — maybe a car engine, a computer file, a router, or a temperature reading. Representing these concepts directly in code comes in two parts: data to represent the state, and functions to represent the behavior. ES6 classes give us a convenient syntax for de...