I'm relating User with same, in Tinker everything works fine, it creates a record in the pivot table
ejemplo en Tinker todo OK
$p=App\User::find(246)
$u=App\User::find(247)
$u->addParent($p)
But in the controller it does not work gives error
"class User not found"
public function parents()
{
return $this->belongsToMany('User', 'parent_user', 'user_id','parent_id'
);
}
public function addParent(User $user)
{
$this->parents()->attach($user->id);
}