From 0fad5119540404ffe11fb322f143b3f96e413c48 Mon Sep 17 00:00:00 2001 From: neoteknic Date: Sat, 2 Mar 2019 15:14:46 +0100 Subject: [PATCH] Fix Bug PHP 7.3 & L5.8 (#774) add cast (string) to disable bug ($type can be null) --- src/Console/ModelsCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Console/ModelsCommand.php b/src/Console/ModelsCommand.php index 587fa29..0b92f85 100644 --- a/src/Console/ModelsCommand.php +++ b/src/Console/ModelsCommand.php @@ -480,7 +480,7 @@ class ModelsCommand extends Command 'morphedByMany' => '\Illuminate\Database\Eloquent\Relations\MorphToMany' ) as $relation => $impl) { $search = '$this->' . $relation . '('; - if (stripos($code, $search) || stripos($impl, $type) !== false) { + if (stripos($code, $search) || stripos($impl, (string)$type) !== false) { //Resolve the relation's model to a Relation object. $methodReflection = new \ReflectionMethod($model, $method); if ($methodReflection->getNumberOfParameters()) {