Skip to content

Commit

Permalink
Merge pull request #659 from manavo/patch-1
Browse files Browse the repository at this point in the history
Don't autoload with class_exists
  • Loading branch information
shalvah authored May 7, 2023
2 parents f8c413c + e69ceaf commit 0efa273
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Extracting/Strategies/UrlParameters/GetFromLaravelAPI.php
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,9 @@ protected function findModelFromUrlThing(string $urlThing): ?Model
$className = str_replace(['-', '_', ' '], '', Str::title($urlThing));
$rootNamespace = app()->getNamespace();

if (class_exists($class = "{$rootNamespace}Models\\" . $className)
if (class_exists($class = "{$rootNamespace}Models\\" . $className, autoload: false)
// For the heathens that don't use a Models\ directory
|| class_exists($class = $rootNamespace . $className)) {
|| class_exists($class = $rootNamespace . $className, autoload: false)) {
try {
$instance = new $class;
} catch (\Error) { // It might be an enum or some other non-instantiable class
Expand Down

0 comments on commit 0efa273

Please sign in to comment.