I have two models (yep I noticed about belongsToMany and HybridRelation):
User - MySQL model with use HybridRelation and relation belongsToMany of Role
Role - MongoDB model without HybridRelation and relation belongsToMany of User
$user is attached to multiple ->roles(). Ids are stored in Role model only.
I try to detach $role from $user via:
$user->roles()->detach($role->_id)
It throws an exception:
BadMethodCallException: Call to undefined method App\Models\User::pull() because Illuminate\Database\Eloquent\Model doesn't contain pull() method, when Jenssegers\Mongodb\Eloquent\Model has it.
Attach ($user->roles()->attach($role->_id)) works correctly. What i'm doing wrong?
I have two models (yep I noticed about belongsToMany and HybridRelation):
$user is attached to multiple ->roles(). Ids are stored in Role model only.
I try to detach $role from $user via:
$user->roles()->detach($role->_id)
It throws an exception:
BadMethodCallException: Call to undefined method App\Models\User::pull()
because Illuminate\Database\Eloquent\Model doesn't contain pull() method, when Jenssegers\Mongodb\Eloquent\Model has it.Attach (
$user->roles()->attach($role->_id)
) works correctly. What i'm doing wrong?Lumen: 6.0 Jenssegers/mongodb: 3.6