Don't autoload with class_exists

This commit is contained in:
Philip Manavopoulos
2023-05-07 15:18:37 +01:00
committed by GitHub
parent f8c413cfd8
commit 00a566ce10

View File

@@ -214,9 +214,9 @@ class GetFromLaravelAPI extends Strategy
$className = str_replace(['-', '_', ' '], '', Str::title($urlThing));
$rootNamespace = app()->getNamespace();
if (class_exists($class = "{$rootNamespace}Models\\" . $className)
if (class_exists($class = "{$rootNamespace}Models\\" . $className, false)
// For the heathens that don't use a Models\ directory
|| class_exists($class = $rootNamespace . $className)) {
|| class_exists($class = $rootNamespace . $className, false)) {
try {
$instance = new $class;
} catch (\Error) { // It might be an enum or some other non-instantiable class