Add support for model_locations

This commit is contained in:
Matthew Hailwood
2014-02-07 12:11:17 +13:00
parent 0166a1bc9b
commit 107fda3c20
@@ -167,11 +167,14 @@ class ModelsCommand extends Command {
protected function loadModels(){ protected function loadModels(){
$dir = base_path().'/'.$this->dir; $default = (array)(base_path().'/'.$this->dir);
$dir = array_merge(\Config::get('laravel-ide-helper::model_locations'),$default);
$models = array(); $models = array();
if(file_exists($dir)){ foreach($dir as $d){
foreach(ClassMapGenerator::createMap($dir) as $model=> $path){ if(file_exists($d)){
$models[] = $model; foreach(ClassMapGenerator::createMap($d) as $model=> $path){
$models[] = $model;
}
} }
} }
return $models; return $models;