Closed Voltra closed 7 months ago
Improved Code Flexibility in Page.php
The parent
and children
methods in the file were restructured. Now, instead of using the Page
class directly, they will leverage the static
keyword. This allows for better flexibility as it can call these methods in any class that extends Page
, increasing our code's adaptability to future changes.
Efficiency Boost in Loading Relationships
The allChildren
method underwent optimization. It now selects only certain columns and prioritizes loading the allChildren
relationship. These alterations should reduce the time and resources needed to execute operations related to this method, enhancing the overall efficiency of our system.
Thanks
Most of the time, when we use this package and need to have additional functionalities in our Page model, we extend the base Page model.
Currently, due to how the relationships were defined, we'd need to override them with extremely similar code.
The proposed change just removes that need altogether by using the leaf class directly, relying on PHP's
static
class name.