Any obvious thing I'm missing?
Parentheses.
$user->interest()->attatch($interestId);
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I'm very confused. When trying to use attatch I get this error.
I'm trying to do: return $user->interest->attatch($interestId);
I get the error in the title. I'm pretty sure my relations are right as I can access existing data in the pivot table with: $user->interest;
Any obvious thing I'm missing? I can't find anything on Google except something about permissions, but there's no info on where this code should be inserted.
Please or to participate in this conversation.