作者:坏坏不贱_233 | 来源:互联网 | 2023-08-26 20:28
I'm trying to get a one to many relationship working. I tried doing a couple of things:
1 2 3
| $container->items()->save($entity) ; // This does absolutely nothing
$entity->container()->associate($container); // Partially worked by creating the parent_id but the parent model doesn't now about the children. |
Please advice.
该提问来源于开源项目:jenssegers/laravel-mongodb
Closing this ticket, I was incorrectly calling
This works: