Laravel eloquent: How does relation inherit functions from query builder?

  eloquent, laravel

how do they achieve, that IlluminateDatabaseEloquentRelationsRelation has access to all query builder functions?

enter image description here

I see they have a $query property, but does not explain how all its methods are available inside relation

Source: Laravel

Leave a Reply