The method in example isn’t working, I get an ArgumentCountError. Is there a way to pass extra parameter in the PHP callback signature or by any other method ?
A PHP callback for customizing the relation associated with the junction table. Its signature should be function($query), where $query is the query to be customized.