mirror of
https://github.com/barryvdh/laravel-ide-helper.git
synced 2026-08-18 18:13:11 +00:00
Merge pull request #326 from valorin/master
Allow for camel case model properties.
This commit is contained in:
@@ -487,6 +487,11 @@ class ModelsCommand extends Command
|
||||
} else {
|
||||
$attr = 'property-read';
|
||||
}
|
||||
|
||||
if ($this->hasCamelCaseModelProperties()) {
|
||||
$name = Str::camel($name);
|
||||
}
|
||||
|
||||
$tagLine = trim("@{$attr} {$property['type']} {$name} {$property['comment']}");
|
||||
$tag = Tag::createInstance($tagLine, $phpdoc);
|
||||
$phpdoc->appendTag($tag);
|
||||
@@ -586,4 +591,12 @@ class ModelsCommand extends Command
|
||||
$model = new $className;
|
||||
return '\\' . get_class($model->newCollection());
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
protected function hasCamelCaseModelProperties()
|
||||
{
|
||||
return $this->laravel['config']->get('ide-helper.model_camel_case_properties', false);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user