July 14, 2017
You’ve probably used different types of relationships between models or database tables, like those commonly seen in Laravel: one-to-one, one-to-many, many-to-many, and has-many-through. But there’s another type of relationship that’s not so common: polymorphic. So what is a polymorphic relationship?
December 16, 2016
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...
November 16, 2016
If you’ve used Eloquent on medium to large projects before, you may have encountered a situation where you want to take action when something happens to your models. Eloquent provides a convenient way to do so.
The Observer Pattern
The observer pattern is a software design pattern in which an object, called the...
November 6, 2016
Developers usually stick with a new CMS for its simplicity and extensibility. OctoberCMS presents itself as a back to basics CMS, and provides an enjoyable experience for both developers and users. In this article, I’m going to demonstrate some aspects of the CMS that makes it extensible, and we’ll also try...
November 27, 2015
The Aggregate pattern is an important part of Domain Driven Design. It prevents inconsistencies and is responsible for enforcing business rules within a collection of objects. For these reasons alone, it is clear to see why it is a key component of a domain model.
Architectural advice recommends that the layer containi...