From 00a566ce10368744613d2ec72d6fa3cc60da43c1 Mon Sep 17 00:00:00 2001 From: Philip Manavopoulos Date: Sun, 7 May 2023 15:18:37 +0100 Subject: [PATCH] Don't autoload with class_exists --- src/Extracting/Strategies/UrlParameters/GetFromLaravelAPI.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Extracting/Strategies/UrlParameters/GetFromLaravelAPI.php b/src/Extracting/Strategies/UrlParameters/GetFromLaravelAPI.php index 8f34723..a60c854 100644 --- a/src/Extracting/Strategies/UrlParameters/GetFromLaravelAPI.php +++ b/src/Extracting/Strategies/UrlParameters/GetFromLaravelAPI.php @@ -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