Support the ongoing development of Laravel.io →
Database Eloquent

I have 2 tables which are related with a Many to Many relation and the relation table. (users, items, users_items) I now want to do something like this: (pseudocode)

$user = User::find(1), 
$user = user->ItemsHeIsNoRelatedTo();

How would i pull that off the laravel way? Do i have to write some algorithm into my user model? Or is there even a specifc eloquent way of doing this?

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

meneman meneman Joined 7 May 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.