We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Your extension looks very promising. However I'm not sure how it handles more levels of many-to-many relations.
Example: App\User belongsToMany App\Group belongsToMany App\Album belongsToMany App\Photo.
App\User
App\Group
App\Album
App\Photo
How would I get photos belonging to a user? I'm wondering how I would use the hasManyDeep() method.
hasManyDeep()
The text was updated successfully, but these errors were encountered:
It's possible like this:
class User extends Model { use \Staudenmeir\EloquentHasManyDeep\HasRelationships; public function photos() { return $this->hasManyDeep( 'App\Photo', ['group_user', 'App\Group', 'album_group', 'App\Album', 'album_photo'] ); } }
Sorry, something went wrong.
Works. Thank you very much!
No branches or pull requests
Your extension looks very promising. However I'm not sure how it handles more levels of many-to-many relations.
Example:
App\User
belongsToManyApp\Group
belongsToManyApp\Album
belongsToManyApp\Photo
.How would I get photos belonging to a user? I'm wondering how I would use the
hasManyDeep()
method.The text was updated successfully, but these errors were encountered: