mirror of
https://github.com/ambieco/scribe.git
synced 2026-01-12 22:43:50 +08:00
Don't autoload with class_exists
This commit is contained in:
committed by
GitHub
parent
f8c413cfd8
commit
00a566ce10
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user