1010use Illuminate \Database \Eloquent \Relations \BelongsToMany as EloquentBelongsToMany ;
1111use Illuminate \Support \Arr ;
1212use MongoDB \Laravel \Eloquent \Model as DocumentModel ;
13+ use Override ;
1314
1415use function array_diff ;
1516use function array_keys ;
@@ -39,12 +40,14 @@ public function getHasCompareKey()
3940 }
4041
4142 /** @inheritdoc */
43+ #[Override]
4244 public function getRelationExistenceQuery (Builder $ query , Builder $ parentQuery , $ columns = ['* ' ])
4345 {
4446 return $ query ;
4547 }
4648
4749 /** @inheritdoc */
50+ #[Override]
4851 protected function hydratePivotRelation (array $ models )
4952 {
5053 // Do nothing.
@@ -61,12 +64,14 @@ protected function getSelectColumns(array $columns = ['*'])
6164 }
6265
6366 /** @inheritdoc */
67+ #[Override]
6468 protected function shouldSelect (array $ columns = ['* ' ])
6569 {
6670 return $ columns ;
6771 }
6872
6973 /** @inheritdoc */
74+ #[Override]
7075 public function addConstraints ()
7176 {
7277 if (static ::$ constraints ) {
@@ -89,6 +94,7 @@ protected function setWhere()
8994 }
9095
9196 /** @inheritdoc */
97+ #[Override]
9298 public function save (Model $ model , array $ pivotAttributes = [], $ touch = true )
9399 {
94100 $ model ->save (['touch ' => false ]);
@@ -99,6 +105,7 @@ public function save(Model $model, array $pivotAttributes = [], $touch = true)
99105 }
100106
101107 /** @inheritdoc */
108+ #[Override]
102109 public function create (array $ attributes = [], array $ joining = [], $ touch = true )
103110 {
104111 $ instance = $ this ->related ->newInstance ($ attributes );
@@ -114,6 +121,7 @@ public function create(array $attributes = [], array $joining = [], $touch = tru
114121 }
115122
116123 /** @inheritdoc */
124+ #[Override]
117125 public function sync ($ ids , $ detaching = true )
118126 {
119127 $ changes = [
@@ -177,13 +185,15 @@ public function sync($ids, $detaching = true)
177185 }
178186
179187 /** @inheritdoc */
188+ #[Override]
180189 public function updateExistingPivot ($ id , array $ attributes , $ touch = true )
181190 {
182191 // Do nothing, we have no pivot table.
183192 return $ this ;
184193 }
185194
186195 /** @inheritdoc */
196+ #[Override]
187197 public function attach ($ id , array $ attributes = [], $ touch = true )
188198 {
189199 if ($ id instanceof Model) {
@@ -224,6 +234,7 @@ public function attach($id, array $attributes = [], $touch = true)
224234 }
225235
226236 /** @inheritdoc */
237+ #[Override]
227238 public function detach ($ ids = [], $ touch = true )
228239 {
229240 if ($ ids instanceof Model) {
@@ -264,6 +275,7 @@ public function detach($ids = [], $touch = true)
264275 }
265276
266277 /** @inheritdoc */
278+ #[Override]
267279 protected function buildDictionary (Collection $ results )
268280 {
269281 $ foreign = $ this ->foreignPivotKey ;
@@ -283,6 +295,7 @@ protected function buildDictionary(Collection $results)
283295 }
284296
285297 /** @inheritdoc */
298+ #[Override]
286299 public function newPivotQuery ()
287300 {
288301 return $ this ->newRelatedQuery ();
@@ -309,12 +322,14 @@ public function getForeignKey()
309322 }
310323
311324 /** @inheritdoc */
325+ #[Override]
312326 public function getQualifiedForeignPivotKeyName ()
313327 {
314328 return $ this ->foreignPivotKey ;
315329 }
316330
317331 /** @inheritdoc */
332+ #[Override]
318333 public function getQualifiedRelatedPivotKeyName ()
319334 {
320335 return $ this ->relatedPivotKey ;
@@ -323,10 +338,9 @@ public function getQualifiedRelatedPivotKeyName()
323338 /**
324339 * Get the name of the "where in" method for eager loading.
325340 *
326- * @param string $key
327- *
328- * @return string
341+ * @inheritdoc
329342 */
343+ #[Override]
330344 protected function whereInMethod (Model $ model , $ key )
331345 {
332346 return 'whereIn ' ;
0 commit comments