August 2025
Intermediate to advanced
294 pages
6h 59m
English
Calculations[55] are an awesome way of defining a special type of attribute that isn’t stored in your database but is calculated on demand from other information, like a virtual field. You can use data from related resources, from files on the filesystem, from external sources, or even use just some way of tweaking, deriving, or reformatting data you already store for that resource. Calculations have to be specifically loaded when reading data, the same way you load a relationship; but once they’re loaded, they can be treated like any other attribute of a resource.
Let’s say we wanted to display how many years ago each album was released on an artist’s profile page. That’ll ...
Read now
Unlock full access