Fix return type of methods provided by SoftDeletes (#1345)

* Fix return type of methods provided by `SoftDeletes`

* Update CHANGELOG

* fix test / update snapshot
This commit is contained in:
KentarouTakeda
2022-08-11 12:36:43 +02:00
committed by GitHub
parent c76fbb5b61
commit 07f5eaea73
5 changed files with 11 additions and 10 deletions
+1 -1
View File
@@ -1208,7 +1208,7 @@ class ModelsCommand extends Command
$traits = class_uses_recursive($model);
if (in_array('Illuminate\\Database\\Eloquent\\SoftDeletes', $traits)) {
$modelName = $this->getClassNameInDestinationFile($model, get_class($model));
$builder = $this->getClassNameInDestinationFile($model, \Illuminate\Database\Query\Builder::class);
$builder = $this->getClassNameInDestinationFile($model, \Illuminate\Database\Eloquent\Builder::class);
$this->setMethod('withTrashed', $builder . '|' . $modelName, []);
$this->setMethod('withoutTrashed', $builder . '|' . $modelName, []);
$this->setMethod('onlyTrashed', $builder . '|' . $modelName, []);