Prechádzať zdrojové kódy

Update GetFromLaravelAPI.php

Yannik Firre 3 rokov pred
rodič
commit
acfb1ceba3

+ 1 - 1
src/Extracting/Strategies/UrlParameters/GetFromLaravelAPI.php

@@ -69,7 +69,7 @@ class GetFromLaravelAPI extends Strategy
                     $type = $this->normalizeTypeName($typeName);
                     $parameters[$paramName]['type'] = $type;
 
-                    $example  = optional($argumentInstance::first())->id;
+                    $example  = $argumentInstance::first()->id ?? null;
 
                     if($example === null) {
                         // If the user explicitly set a `where()` constraint, use that to refine examples