How do I create a new instance of an eloquent model with relationships.
This is what I am trying:
$user = new User();
$user->name = 'Test Name';
$user->friends()->attach(1);
$user->save();
But I get
Call to undefined method Illuminate\Database\Query\Builder::attach()