22
33namespace Oddvalue \LaravelDrafts \Concerns ;
44
5- use Illuminate \ Contracts \ Database \ Query \ Builder as QueryBuilder ;
5+ use Closure ;
66use Illuminate \Database \Eloquent \Builder ;
77use Illuminate \Database \Eloquent \Model ;
88use Illuminate \Database \Eloquent \Relations \BelongsToMany ;
@@ -339,12 +339,12 @@ public function save(array $options = []): bool
339339 return parent ::save ($ options );
340340 }
341341
342- public static function savingAsDraft (string |\ Closure $ callback ): void
342+ public static function savingAsDraft (string |Closure $ callback ): void
343343 {
344344 static ::registerModelEvent ('savingAsDraft ' , $ callback );
345345 }
346346
347- public static function savedAsDraft (string |\ Closure $ callback ): void
347+ public static function savedAsDraft (string |Closure $ callback ): void
348348 {
349349 static ::registerModelEvent ('drafted ' , $ callback );
350350 }
@@ -491,7 +491,7 @@ public function publisher(): MorphTo
491491 /**
492492 * @param Builder<Model> $query
493493 */
494- public function scopeCurrent (Builder $ query ): void
494+ protected function scopeCurrent (Builder $ query ): void
495495 {
496496 /** @phpstan-ignore method.notFound, method.nonObject */
497497 $ query ->withDrafts ()->where ($ this ->getIsCurrentColumn (), true );
@@ -500,15 +500,15 @@ public function scopeCurrent(Builder $query): void
500500 /**
501501 * @param Builder<Model> $query
502502 */
503- public function scopeWithoutCurrent (Builder $ query ): void
503+ protected function scopeWithoutCurrent (Builder $ query ): void
504504 {
505505 $ query ->where ($ this ->getIsCurrentColumn (), false );
506506 }
507507
508508 /**
509509 * @param Builder<Model> $query
510510 */
511- public function scopeExcludeRevision (Builder $ query , int | Model $ exclude ): void
511+ protected function scopeExcludeRevision (Builder $ query , int | Model $ exclude ): void
512512 {
513513 $ query ->where ($ this ->getKeyName (), '!= ' , is_int ($ exclude ) ? $ exclude : $ exclude ->getKey ());
514514 }
@@ -517,7 +517,7 @@ public function scopeExcludeRevision(Builder $query, int | Model $exclude): void
517517 * @deprecated This doesn't actually work, will be removed in next version
518518 * @param Builder<Model> $query
519519 */
520- public function scopeWithoutSelf (Builder $ query ): void
520+ protected function scopeWithoutSelf (Builder $ query ): void
521521 {
522522 /** @phpstan-ignore argument.type */
523523 $ query ->where ('id ' , '!= ' , $ this ->id );
@@ -532,7 +532,7 @@ public function scopeWithoutSelf(Builder $query): void
532532 /**
533533 * @return static|null
534534 */
535- public function getDraftAttribute (): ?self
535+ protected function getDraftAttribute (): ?self
536536 {
537537 if ($ this ->relationLoaded ('drafts ' )) {
538538 /** @phpstan-ignore return.type */
0 commit comments