Skip to content

Commit

Permalink
Fix getting namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeMnD authored Feb 24, 2017
1 parent 66139db commit 0d9973f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Services/IndexService.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ public function getAllSearchableModels($directories)
$files = glob($directory.'/*.php');

foreach ($files as $file) {
$class = $this->getAppNamespace().basename($file, '.php');
$classes = get_declared_classes();
include $file;
$diff = array_diff(get_declared_classes(), $classes);
$class = reset($diff);

$modelInstance = new $class();

Expand Down

0 comments on commit 0d9973f

Please sign in to comment.