From b8dbd7a5c323c76bb24a35d408438bd1460057c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Tamarelle?= Date: Wed, 30 Aug 2023 17:03:48 +0200 Subject: [PATCH] Make EmbedsRelations::embedsMany and EmbedsRelations::embedsOne public --- CHANGELOG.md | 1 + src/Eloquent/EmbedsRelations.php | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 962d4aa03..fb0ee86c0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ All notable changes to this project will be documented in this file. - Change signature of `Query\Builder::__constructor` to match the parent class [#26](https://github.com/GromNaN/laravel-mongodb-private/pull/26) by [@GromNaN](https://github.com/GromNaN). - Fix Query on `whereDate`, `whereDay`, `whereMonth`, `whereYear`, `whereTime` to use MongoDB operators [#2570](https://github.com/jenssegers/laravel-mongodb/pull/2376) by [@Davpyu](https://github.com/Davpyu) and [@GromNaN](https://github.com/GromNaN). - `Model::unset()` does not persist the change. Call `Model::save()` to persist the change [#2578](https://github.com/jenssegers/laravel-mongodb/pull/2578) by [@GromNaN](https://github.com/GromNaN). +- Make `EmbedsRelations::embedsMany` and `EmbedsRelations::embedsOne` public [#2588](https://github.com/mongodb/laravel-mongodb/pull/2588) by [@GromNaN](https://github.com/GromNaN). ## [3.9.2] - 2022-09-01 diff --git a/src/Eloquent/EmbedsRelations.php b/src/Eloquent/EmbedsRelations.php index 32ceb7fa4..283bd340f 100644 --- a/src/Eloquent/EmbedsRelations.php +++ b/src/Eloquent/EmbedsRelations.php @@ -20,7 +20,7 @@ trait EmbedsRelations * @param string $relation * @return \MongoDB\Laravel\Relations\EmbedsMany */ - protected function embedsMany($related, $localKey = null, $foreignKey = null, $relation = null) + public function embedsMany($related, $localKey = null, $foreignKey = null, $relation = null) { // If no relation name was given, we will use this debug backtrace to extract // the calling method's name and use that as the relationship name as most @@ -53,7 +53,7 @@ protected function embedsMany($related, $localKey = null, $foreignKey = null, $r * @param string $relation * @return \MongoDB\Laravel\Relations\EmbedsOne */ - protected function embedsOne($related, $localKey = null, $foreignKey = null, $relation = null) + public function embedsOne($related, $localKey = null, $foreignKey = null, $relation = null) { // If no relation name was given, we will use this debug backtrace to extract // the calling method's name and use that as the relationship name as most