For anyone still looking for a Laravel-like solution for defining custom relationships, I highly recommend checking out the Custom Relation package. As of 2025, it's actively maintained and provides a robust way to create any relation that doesn't fit into Laravel's built-in options.
For example, I needed a relation between two models based on matching 2 date columns. Using this package, I was able to quickly define a solution that works seamlessly with both lazy and eager loading.