when you use () it compounds with Query Builder and lets you continue query operations on the next item... When you do not, it pulls the relationship instead...
Auth::User()->organization->id;
Auth::User()->organization()->where('organization_id', 1)->get();
Okay. Thanks!
In this case using the query builder wouldn't make much sense, but if it's a many-to-many or hasmany relationship it would.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community